
bin/kernel:     file format elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:
.text

.globl kern_entry
kern_entry:
	# load temperate gdt
	lgdt REALLOC(__gdtdesc)
c0100000:	0f 01 15 18 a0 11 00 	lgdtl  0x11a018
	movl $KERNEL_DS, %eax
c0100007:	b8 10 00 00 00       	mov    $0x10,%eax
	movw %ax, %ds
c010000c:	8e d8                	mov    %eax,%ds
	movw %ax, %es
c010000e:	8e c0                	mov    %eax,%es
	movw %ax, %ss
c0100010:	8e d0                	mov    %eax,%ss

	ljmp $KERNEL_CS, $relocated
c0100012:	ea 19 00 10 c0 08 00 	ljmp   $0x8,$0xc0100019

c0100019 <relocated>:

relocated:

	# set ebp, esp
	movl $0x0, %ebp
c0100019:	bd 00 00 00 00       	mov    $0x0,%ebp

	movl $bootstacktop, %esp
c010001e:	bc 00 a0 11 c0       	mov    $0xc011a000,%esp

	call kern_init
c0100023:	e8 04 00 00 00       	call   c010002c <kern_init>

c0100028 <spin>:

# should never get here
spin:
	jmp spin
c0100028:	eb fe                	jmp    c0100028 <spin>
	...

c010002c <kern_init>:
#include <pmm.h>

int kern_init(void) __attribute__((noreturn));

int
kern_init(void) {
c010002c:	55                   	push   %ebp
c010002d:	89 e5                	mov    %esp,%ebp
c010002f:	83 ec 28             	sub    $0x28,%esp
	extern char edata[], end[];
	memset(edata, 0, end - edata);
c0100032:	ba 9c ba 11 c0       	mov    $0xc011ba9c,%edx
c0100037:	b8 98 aa 11 c0       	mov    $0xc011aa98,%eax
c010003c:	89 d1                	mov    %edx,%ecx
c010003e:	29 c1                	sub    %eax,%ecx
c0100040:	89 c8                	mov    %ecx,%eax
c0100042:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100046:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c010004d:	00 
c010004e:	c7 04 24 98 aa 11 c0 	movl   $0xc011aa98,(%esp)
c0100055:	e8 a9 6b 00 00       	call   c0106c03 <memset>

	cons_init();				// init the console
c010005a:	e8 5c 1f 00 00       	call   c0101fbb <cons_init>

	const char *message = "(THU.CST) os is loading ...";
c010005f:	c7 45 f4 c0 6d 10 c0 	movl   $0xc0106dc0,-0xc(%ebp)
	cprintf("%s\n\n", message);
c0100066:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100069:	89 44 24 04          	mov    %eax,0x4(%esp)
c010006d:	c7 04 24 dc 6d 10 c0 	movl   $0xc0106ddc,(%esp)
c0100074:	e8 37 01 00 00       	call   c01001b0 <cprintf>

	print_kerninfo();
c0100079:	e8 84 06 00 00       	call   c0100702 <print_kerninfo>

	debug_init();				// init debug registers
c010007e:	e8 eb 0b 00 00       	call   c0100c6e <debug_init>
	pmm_init();					// init physical memory management
c0100083:	e8 7b 4f 00 00       	call   c0105003 <pmm_init>

	pic_init();					// init interrupt controller
c0100088:	e8 a0 20 00 00       	call   c010212d <pic_init>
	idt_init();					// init interrupt descriptor table
c010008d:	e8 f2 21 00 00       	call   c0102284 <idt_init>

	clock_init();				// init clock interrupt
c0100092:	e8 31 16 00 00       	call   c01016c8 <clock_init>
	intr_enable();				// enable irq interrupt
c0100097:	e8 f8 1f 00 00       	call   c0102094 <intr_enable>

	/* do nothing */
	while (1);
c010009c:	eb fe                	jmp    c010009c <kern_init+0x70>
	...

c01000a0 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c01000a0:	55                   	push   %ebp
c01000a1:	89 e5                	mov    %esp,%ebp
c01000a3:	83 ec 28             	sub    $0x28,%esp
	if (prompt != NULL) {
c01000a6:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01000aa:	74 13                	je     c01000bf <readline+0x1f>
		cprintf("%s", prompt);
c01000ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01000af:	89 44 24 04          	mov    %eax,0x4(%esp)
c01000b3:	c7 04 24 e1 6d 10 c0 	movl   $0xc0106de1,(%esp)
c01000ba:	e8 f1 00 00 00       	call   c01001b0 <cprintf>
	}
	int i = 0, c;
c01000bf:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01000c6:	eb 01                	jmp    c01000c9 <readline+0x29>
		else if (c == '\n' || c == '\r') {
			cputchar(c);
			buf[i] = '\0';
			return buf;
		}
	}
c01000c8:	90                   	nop
	if (prompt != NULL) {
		cprintf("%s", prompt);
	}
	int i = 0, c;
	while (1) {
		c = getchar();
c01000c9:	e8 70 01 00 00       	call   c010023e <getchar>
c01000ce:	89 45 f0             	mov    %eax,-0x10(%ebp)
		if (c < 0) {
c01000d1:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01000d5:	79 07                	jns    c01000de <readline+0x3e>
			return NULL;
c01000d7:	b8 00 00 00 00       	mov    $0x0,%eax
c01000dc:	eb 79                	jmp    c0100157 <readline+0xb7>
		}
		else if (c >= ' ' && i < BUFSIZE - 1) {
c01000de:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
c01000e2:	7e 28                	jle    c010010c <readline+0x6c>
c01000e4:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
c01000eb:	7f 1f                	jg     c010010c <readline+0x6c>
			cputchar(c);
c01000ed:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01000f0:	89 04 24             	mov    %eax,(%esp)
c01000f3:	e8 e1 00 00 00       	call   c01001d9 <cputchar>
			buf[i ++] = c;
c01000f8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01000fb:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01000fe:	81 c2 a0 aa 11 c0    	add    $0xc011aaa0,%edx
c0100104:	88 02                	mov    %al,(%edx)
c0100106:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010010a:	eb 46                	jmp    c0100152 <readline+0xb2>
		}
		else if (c == '\b' && i > 0) {
c010010c:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
c0100110:	75 17                	jne    c0100129 <readline+0x89>
c0100112:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100116:	7e 11                	jle    c0100129 <readline+0x89>
			cputchar(c);
c0100118:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010011b:	89 04 24             	mov    %eax,(%esp)
c010011e:	e8 b6 00 00 00       	call   c01001d9 <cputchar>
			i --;
c0100123:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c0100127:	eb 29                	jmp    c0100152 <readline+0xb2>
		}
		else if (c == '\n' || c == '\r') {
c0100129:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
c010012d:	74 06                	je     c0100135 <readline+0x95>
c010012f:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
c0100133:	75 93                	jne    c01000c8 <readline+0x28>
			cputchar(c);
c0100135:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100138:	89 04 24             	mov    %eax,(%esp)
c010013b:	e8 99 00 00 00       	call   c01001d9 <cputchar>
			buf[i] = '\0';
c0100140:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100143:	05 a0 aa 11 c0       	add    $0xc011aaa0,%eax
c0100148:	c6 00 00             	movb   $0x0,(%eax)
			return buf;
c010014b:	b8 a0 aa 11 c0       	mov    $0xc011aaa0,%eax
c0100150:	eb 05                	jmp    c0100157 <readline+0xb7>
		}
	}
c0100152:	e9 72 ff ff ff       	jmp    c01000c9 <readline+0x29>
}
c0100157:	c9                   	leave  
c0100158:	c3                   	ret    
c0100159:	00 00                	add    %al,(%eax)
	...

c010015c <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c010015c:	55                   	push   %ebp
c010015d:	89 e5                	mov    %esp,%ebp
c010015f:	83 ec 18             	sub    $0x18,%esp
	cons_putc(c);
c0100162:	8b 45 08             	mov    0x8(%ebp),%eax
c0100165:	89 04 24             	mov    %eax,(%esp)
c0100168:	e8 7a 1e 00 00       	call   c0101fe7 <cons_putc>
	(*cnt) ++;
c010016d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100170:	8b 00                	mov    (%eax),%eax
c0100172:	8d 50 01             	lea    0x1(%eax),%edx
c0100175:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100178:	89 10                	mov    %edx,(%eax)
}
c010017a:	c9                   	leave  
c010017b:	c3                   	ret    

c010017c <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c010017c:	55                   	push   %ebp
c010017d:	89 e5                	mov    %esp,%ebp
c010017f:	83 ec 28             	sub    $0x28,%esp
	int cnt = 0;
c0100182:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	vprintfmt((void*)cputch, &cnt, fmt, ap);
c0100189:	b8 5c 01 10 c0       	mov    $0xc010015c,%eax
c010018e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100191:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0100195:	8b 55 08             	mov    0x8(%ebp),%edx
c0100198:	89 54 24 08          	mov    %edx,0x8(%esp)
c010019c:	8d 55 f4             	lea    -0xc(%ebp),%edx
c010019f:	89 54 24 04          	mov    %edx,0x4(%esp)
c01001a3:	89 04 24             	mov    %eax,(%esp)
c01001a6:	e8 30 62 00 00       	call   c01063db <vprintfmt>
	return cnt;
c01001ab:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01001ae:	c9                   	leave  
c01001af:	c3                   	ret    

c01001b0 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c01001b0:	55                   	push   %ebp
c01001b1:	89 e5                	mov    %esp,%ebp
c01001b3:	83 ec 28             	sub    $0x28,%esp
	va_list ap;
	int cnt;
	va_start(ap, fmt);
c01001b6:	8d 45 08             	lea    0x8(%ebp),%eax
c01001b9:	83 c0 04             	add    $0x4,%eax
c01001bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
	cnt = vcprintf(fmt, ap);
c01001bf:	8b 45 08             	mov    0x8(%ebp),%eax
c01001c2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01001c5:	89 54 24 04          	mov    %edx,0x4(%esp)
c01001c9:	89 04 24             	mov    %eax,(%esp)
c01001cc:	e8 ab ff ff ff       	call   c010017c <vcprintf>
c01001d1:	89 45 f0             	mov    %eax,-0x10(%ebp)
	va_end(ap);
	return cnt;
c01001d4:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c01001d7:	c9                   	leave  
c01001d8:	c3                   	ret    

c01001d9 <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c01001d9:	55                   	push   %ebp
c01001da:	89 e5                	mov    %esp,%ebp
c01001dc:	83 ec 18             	sub    $0x18,%esp
	cons_putc(c);
c01001df:	8b 45 08             	mov    0x8(%ebp),%eax
c01001e2:	89 04 24             	mov    %eax,(%esp)
c01001e5:	e8 fd 1d 00 00       	call   c0101fe7 <cons_putc>
}
c01001ea:	c9                   	leave  
c01001eb:	c3                   	ret    

c01001ec <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01001ec:	55                   	push   %ebp
c01001ed:	89 e5                	mov    %esp,%ebp
c01001ef:	83 ec 28             	sub    $0x28,%esp
	int cnt = 0;
c01001f2:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
	char c;
	while ((c = *str ++) != '\0') {
c01001f9:	eb 13                	jmp    c010020e <cputs+0x22>
		cputch(c, &cnt);
c01001fb:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c01001ff:	8d 55 f0             	lea    -0x10(%ebp),%edx
c0100202:	89 54 24 04          	mov    %edx,0x4(%esp)
c0100206:	89 04 24             	mov    %eax,(%esp)
c0100209:	e8 4e ff ff ff       	call   c010015c <cputch>
 * */
int
cputs(const char *str) {
	int cnt = 0;
	char c;
	while ((c = *str ++) != '\0') {
c010020e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100211:	0f b6 00             	movzbl (%eax),%eax
c0100214:	88 45 f7             	mov    %al,-0x9(%ebp)
c0100217:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c010021b:	0f 95 c0             	setne  %al
c010021e:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0100222:	84 c0                	test   %al,%al
c0100224:	75 d5                	jne    c01001fb <cputs+0xf>
		cputch(c, &cnt);
	}
	cputch('\n', &cnt);
c0100226:	8d 45 f0             	lea    -0x10(%ebp),%eax
c0100229:	89 44 24 04          	mov    %eax,0x4(%esp)
c010022d:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
c0100234:	e8 23 ff ff ff       	call   c010015c <cputch>
	return cnt;
c0100239:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c010023c:	c9                   	leave  
c010023d:	c3                   	ret    

c010023e <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c010023e:	55                   	push   %ebp
c010023f:	89 e5                	mov    %esp,%ebp
c0100241:	83 ec 18             	sub    $0x18,%esp
	int c;
	while ((c = cons_getc()) == 0)
c0100244:	e8 da 1d 00 00       	call   c0102023 <cons_getc>
c0100249:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010024c:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100250:	74 f2                	je     c0100244 <getchar+0x6>
		/* do nothing */;
	return c;
c0100252:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100255:	c9                   	leave  
c0100256:	c3                   	ret    
	...

c0100258 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0100258:	55                   	push   %ebp
c0100259:	89 e5                	mov    %esp,%ebp
c010025b:	53                   	push   %ebx
c010025c:	83 ec 14             	sub    $0x14,%esp
}

static inline uint32_t
read_eflags(void) {
	uint32_t eflags;
	asm volatile ("pushfl; popl %0" : "=r" (eflags));
c010025f:	9c                   	pushf  
c0100260:	5b                   	pop    %ebx
c0100261:	89 5d f4             	mov    %ebx,-0xc(%ebp)
	return eflags;
c0100264:	8b 45 f4             	mov    -0xc(%ebp),%eax
	if (read_eflags() & FL_IF) {
c0100267:	25 00 02 00 00       	and    $0x200,%eax
c010026c:	85 c0                	test   %eax,%eax
c010026e:	74 0c                	je     c010027c <__intr_save+0x24>
		intr_disable();
c0100270:	e8 25 1e 00 00       	call   c010209a <intr_disable>
		return 1;
c0100275:	b8 01 00 00 00       	mov    $0x1,%eax
c010027a:	eb 05                	jmp    c0100281 <__intr_save+0x29>
	}
	return 0;
c010027c:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100281:	83 c4 14             	add    $0x14,%esp
c0100284:	5b                   	pop    %ebx
c0100285:	5d                   	pop    %ebp
c0100286:	c3                   	ret    

c0100287 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0100287:	55                   	push   %ebp
c0100288:	89 e5                	mov    %esp,%ebp
c010028a:	83 ec 08             	sub    $0x8,%esp
	if (flag) {
c010028d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100291:	74 05                	je     c0100298 <__intr_restore+0x11>
		intr_enable();
c0100293:	e8 fc 1d 00 00       	call   c0102094 <intr_enable>
	}
}
c0100298:	c9                   	leave  
c0100299:	c3                   	ret    

c010029a <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
	       int type, uintptr_t addr) {
c010029a:	55                   	push   %ebp
c010029b:	89 e5                	mov    %esp,%ebp
c010029d:	83 ec 20             	sub    $0x20,%esp
	int l = *region_left, r = *region_right, any_matches = 0;
c01002a0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01002a3:	8b 00                	mov    (%eax),%eax
c01002a5:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01002a8:	8b 45 10             	mov    0x10(%ebp),%eax
c01002ab:	8b 00                	mov    (%eax),%eax
c01002ad:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01002b0:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	while (l <= r) {
c01002b7:	e9 c8 00 00 00       	jmp    c0100384 <stab_binsearch+0xea>
		int true_m = (l + r) / 2, m = true_m;
c01002bc:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01002bf:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01002c2:	8d 04 02             	lea    (%edx,%eax,1),%eax
c01002c5:	89 c2                	mov    %eax,%edx
c01002c7:	c1 ea 1f             	shr    $0x1f,%edx
c01002ca:	8d 04 02             	lea    (%edx,%eax,1),%eax
c01002cd:	d1 f8                	sar    %eax
c01002cf:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01002d2:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01002d5:	89 45 f0             	mov    %eax,-0x10(%ebp)

		// search for earliest stab with right type
		while (m >= l && stabs[m].n_type != type) {
c01002d8:	eb 04                	jmp    c01002de <stab_binsearch+0x44>
			m --;
c01002da:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)

	while (l <= r) {
		int true_m = (l + r) / 2, m = true_m;

		// search for earliest stab with right type
		while (m >= l && stabs[m].n_type != type) {
c01002de:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002e1:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c01002e4:	7c 1b                	jl     c0100301 <stab_binsearch+0x67>
c01002e6:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01002e9:	89 d0                	mov    %edx,%eax
c01002eb:	01 c0                	add    %eax,%eax
c01002ed:	01 d0                	add    %edx,%eax
c01002ef:	c1 e0 02             	shl    $0x2,%eax
c01002f2:	03 45 08             	add    0x8(%ebp),%eax
c01002f5:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01002f9:	0f b6 c0             	movzbl %al,%eax
c01002fc:	3b 45 14             	cmp    0x14(%ebp),%eax
c01002ff:	75 d9                	jne    c01002da <stab_binsearch+0x40>
			m --;
		}
		if (m < l) {	// no match in [l, m]
c0100301:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100304:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100307:	7d 0b                	jge    c0100314 <stab_binsearch+0x7a>
			l = true_m + 1;
c0100309:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010030c:	83 c0 01             	add    $0x1,%eax
c010030f:	89 45 fc             	mov    %eax,-0x4(%ebp)
			continue;
c0100312:	eb 70                	jmp    c0100384 <stab_binsearch+0xea>
		}

		// actual binary search
		any_matches = 1;
c0100314:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
		if (stabs[m].n_value < addr) {
c010031b:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010031e:	89 d0                	mov    %edx,%eax
c0100320:	01 c0                	add    %eax,%eax
c0100322:	01 d0                	add    %edx,%eax
c0100324:	c1 e0 02             	shl    $0x2,%eax
c0100327:	03 45 08             	add    0x8(%ebp),%eax
c010032a:	8b 40 08             	mov    0x8(%eax),%eax
c010032d:	3b 45 18             	cmp    0x18(%ebp),%eax
c0100330:	73 13                	jae    c0100345 <stab_binsearch+0xab>
			*region_left = m;
c0100332:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100335:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100338:	89 10                	mov    %edx,(%eax)
			l = true_m + 1;
c010033a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010033d:	83 c0 01             	add    $0x1,%eax
c0100340:	89 45 fc             	mov    %eax,-0x4(%ebp)
c0100343:	eb 3f                	jmp    c0100384 <stab_binsearch+0xea>
		} else if (stabs[m].n_value > addr) {
c0100345:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100348:	89 d0                	mov    %edx,%eax
c010034a:	01 c0                	add    %eax,%eax
c010034c:	01 d0                	add    %edx,%eax
c010034e:	c1 e0 02             	shl    $0x2,%eax
c0100351:	03 45 08             	add    0x8(%ebp),%eax
c0100354:	8b 40 08             	mov    0x8(%eax),%eax
c0100357:	3b 45 18             	cmp    0x18(%ebp),%eax
c010035a:	76 16                	jbe    c0100372 <stab_binsearch+0xd8>
			*region_right = m - 1;
c010035c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010035f:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100362:	8b 45 10             	mov    0x10(%ebp),%eax
c0100365:	89 10                	mov    %edx,(%eax)
			r = m - 1;
c0100367:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010036a:	83 e8 01             	sub    $0x1,%eax
c010036d:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0100370:	eb 12                	jmp    c0100384 <stab_binsearch+0xea>
		} else {
			// exact match for 'addr', but continue loop to find
			// *region_right
			*region_left = m;
c0100372:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100375:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100378:	89 10                	mov    %edx,(%eax)
			l = m;
c010037a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010037d:	89 45 fc             	mov    %eax,-0x4(%ebp)
			addr ++;
c0100380:	83 45 18 01          	addl   $0x1,0x18(%ebp)
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
	       int type, uintptr_t addr) {
	int l = *region_left, r = *region_right, any_matches = 0;

	while (l <= r) {
c0100384:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100387:	3b 45 f8             	cmp    -0x8(%ebp),%eax
c010038a:	0f 8e 2c ff ff ff    	jle    c01002bc <stab_binsearch+0x22>
			l = m;
			addr ++;
		}
	}

	if (!any_matches) {
c0100390:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100394:	75 0f                	jne    c01003a5 <stab_binsearch+0x10b>
		*region_right = *region_left - 1;
c0100396:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100399:	8b 00                	mov    (%eax),%eax
c010039b:	8d 50 ff             	lea    -0x1(%eax),%edx
c010039e:	8b 45 10             	mov    0x10(%ebp),%eax
c01003a1:	89 10                	mov    %edx,(%eax)
c01003a3:	eb 3b                	jmp    c01003e0 <stab_binsearch+0x146>
	}
	else {
		// find rightmost region containing 'addr'
		l = *region_right;
c01003a5:	8b 45 10             	mov    0x10(%ebp),%eax
c01003a8:	8b 00                	mov    (%eax),%eax
c01003aa:	89 45 fc             	mov    %eax,-0x4(%ebp)
		for (; l > *region_left && stabs[l].n_type != type; l --)
c01003ad:	eb 04                	jmp    c01003b3 <stab_binsearch+0x119>
c01003af:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
c01003b3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003b6:	8b 00                	mov    (%eax),%eax
c01003b8:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c01003bb:	7d 1b                	jge    c01003d8 <stab_binsearch+0x13e>
c01003bd:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01003c0:	89 d0                	mov    %edx,%eax
c01003c2:	01 c0                	add    %eax,%eax
c01003c4:	01 d0                	add    %edx,%eax
c01003c6:	c1 e0 02             	shl    $0x2,%eax
c01003c9:	03 45 08             	add    0x8(%ebp),%eax
c01003cc:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01003d0:	0f b6 c0             	movzbl %al,%eax
c01003d3:	3b 45 14             	cmp    0x14(%ebp),%eax
c01003d6:	75 d7                	jne    c01003af <stab_binsearch+0x115>
			/* do nothing */;
		*region_left = l;
c01003d8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003db:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01003de:	89 10                	mov    %edx,(%eax)
	}
}
c01003e0:	c9                   	leave  
c01003e1:	c3                   	ret    

c01003e2 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c01003e2:	55                   	push   %ebp
c01003e3:	89 e5                	mov    %esp,%ebp
c01003e5:	53                   	push   %ebx
c01003e6:	83 ec 54             	sub    $0x54,%esp
	const struct stab *stabs, *stab_end;
	const char *stabstr, *stabstr_end;

	info->eip_file = "<unknown>";
c01003e9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003ec:	c7 00 e4 6d 10 c0    	movl   $0xc0106de4,(%eax)
	info->eip_line = 0;
c01003f2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003f5:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
	info->eip_fn_name = "<unknown>";
c01003fc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003ff:	c7 40 08 e4 6d 10 c0 	movl   $0xc0106de4,0x8(%eax)
	info->eip_fn_namelen = 9;
c0100406:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100409:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
	info->eip_fn_addr = addr;
c0100410:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100413:	8b 55 08             	mov    0x8(%ebp),%edx
c0100416:	89 50 10             	mov    %edx,0x10(%eax)
	info->eip_fn_narg = 0;
c0100419:	8b 45 0c             	mov    0xc(%ebp),%eax
c010041c:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

	stabs = __STAB_BEGIN__;
c0100423:	c7 45 f4 f8 85 10 c0 	movl   $0xc01085f8,-0xc(%ebp)
	stab_end = __STAB_END__;
c010042a:	c7 45 f0 ec 48 11 c0 	movl   $0xc01148ec,-0x10(%ebp)
	stabstr = __STABSTR_BEGIN__;
c0100431:	c7 45 ec ed 48 11 c0 	movl   $0xc01148ed,-0x14(%ebp)
	stabstr_end = __STABSTR_END__;
c0100438:	c7 45 e8 a8 75 11 c0 	movl   $0xc01175a8,-0x18(%ebp)

	// String table validity checks
	if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c010043f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100442:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0100445:	76 0d                	jbe    c0100454 <debuginfo_eip+0x72>
c0100447:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010044a:	83 e8 01             	sub    $0x1,%eax
c010044d:	0f b6 00             	movzbl (%eax),%eax
c0100450:	84 c0                	test   %al,%al
c0100452:	74 0a                	je     c010045e <debuginfo_eip+0x7c>
		return -1;
c0100454:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100459:	e9 9e 02 00 00       	jmp    c01006fc <debuginfo_eip+0x31a>
	// 'eip'.  First, we find the basic source file containing 'eip'.
	// Then, we look in that source file for the function.  Then we look
	// for the line number.

	// Search the entire set of stabs for the source file (type N_SO).
	int lfile = 0, rfile = (stab_end - stabs) - 1;
c010045e:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c0100465:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100468:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010046b:	89 d1                	mov    %edx,%ecx
c010046d:	29 c1                	sub    %eax,%ecx
c010046f:	89 c8                	mov    %ecx,%eax
c0100471:	c1 f8 02             	sar    $0x2,%eax
c0100474:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c010047a:	83 e8 01             	sub    $0x1,%eax
c010047d:	89 45 e0             	mov    %eax,-0x20(%ebp)
	stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c0100480:	8b 45 08             	mov    0x8(%ebp),%eax
c0100483:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100487:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
c010048e:	00 
c010048f:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0100492:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100496:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c0100499:	89 44 24 04          	mov    %eax,0x4(%esp)
c010049d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01004a0:	89 04 24             	mov    %eax,(%esp)
c01004a3:	e8 f2 fd ff ff       	call   c010029a <stab_binsearch>
	if (lfile == 0)
c01004a8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01004ab:	85 c0                	test   %eax,%eax
c01004ad:	75 0a                	jne    c01004b9 <debuginfo_eip+0xd7>
		return -1;
c01004af:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01004b4:	e9 43 02 00 00       	jmp    c01006fc <debuginfo_eip+0x31a>

	// Search within that file's stabs for the function definition
	// (N_FUN).
	int lfun = lfile, rfun = rfile;
c01004b9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01004bc:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01004bf:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01004c2:	89 45 d8             	mov    %eax,-0x28(%ebp)
	int lline, rline;
	stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c01004c5:	8b 45 08             	mov    0x8(%ebp),%eax
c01004c8:	89 44 24 10          	mov    %eax,0x10(%esp)
c01004cc:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
c01004d3:	00 
c01004d4:	8d 45 d8             	lea    -0x28(%ebp),%eax
c01004d7:	89 44 24 08          	mov    %eax,0x8(%esp)
c01004db:	8d 45 dc             	lea    -0x24(%ebp),%eax
c01004de:	89 44 24 04          	mov    %eax,0x4(%esp)
c01004e2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01004e5:	89 04 24             	mov    %eax,(%esp)
c01004e8:	e8 ad fd ff ff       	call   c010029a <stab_binsearch>

	if (lfun <= rfun) {
c01004ed:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01004f0:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01004f3:	39 c2                	cmp    %eax,%edx
c01004f5:	7f 72                	jg     c0100569 <debuginfo_eip+0x187>
		// stabs[lfun] points to the function name
		// in the string table, but check bounds just in case.
		if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c01004f7:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01004fa:	89 c2                	mov    %eax,%edx
c01004fc:	89 d0                	mov    %edx,%eax
c01004fe:	01 c0                	add    %eax,%eax
c0100500:	01 d0                	add    %edx,%eax
c0100502:	c1 e0 02             	shl    $0x2,%eax
c0100505:	03 45 f4             	add    -0xc(%ebp),%eax
c0100508:	8b 10                	mov    (%eax),%edx
c010050a:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c010050d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100510:	89 cb                	mov    %ecx,%ebx
c0100512:	29 c3                	sub    %eax,%ebx
c0100514:	89 d8                	mov    %ebx,%eax
c0100516:	39 c2                	cmp    %eax,%edx
c0100518:	73 1e                	jae    c0100538 <debuginfo_eip+0x156>
			info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c010051a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010051d:	89 c2                	mov    %eax,%edx
c010051f:	89 d0                	mov    %edx,%eax
c0100521:	01 c0                	add    %eax,%eax
c0100523:	01 d0                	add    %edx,%eax
c0100525:	c1 e0 02             	shl    $0x2,%eax
c0100528:	03 45 f4             	add    -0xc(%ebp),%eax
c010052b:	8b 00                	mov    (%eax),%eax
c010052d:	89 c2                	mov    %eax,%edx
c010052f:	03 55 ec             	add    -0x14(%ebp),%edx
c0100532:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100535:	89 50 08             	mov    %edx,0x8(%eax)
		}
		info->eip_fn_addr = stabs[lfun].n_value;
c0100538:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010053b:	89 c2                	mov    %eax,%edx
c010053d:	89 d0                	mov    %edx,%eax
c010053f:	01 c0                	add    %eax,%eax
c0100541:	01 d0                	add    %edx,%eax
c0100543:	c1 e0 02             	shl    $0x2,%eax
c0100546:	03 45 f4             	add    -0xc(%ebp),%eax
c0100549:	8b 50 08             	mov    0x8(%eax),%edx
c010054c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010054f:	89 50 10             	mov    %edx,0x10(%eax)
		addr -= info->eip_fn_addr;
c0100552:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100555:	8b 40 10             	mov    0x10(%eax),%eax
c0100558:	29 45 08             	sub    %eax,0x8(%ebp)
		// Search within the function definition for the line number.
		lline = lfun;
c010055b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010055e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
		rline = rfun;
c0100561:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100564:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0100567:	eb 15                	jmp    c010057e <debuginfo_eip+0x19c>
	} else {
		// Couldn't find function stab!  Maybe we're in an assembly
		// file.  Search the whole file for the line number.
		info->eip_fn_addr = addr;
c0100569:	8b 45 0c             	mov    0xc(%ebp),%eax
c010056c:	8b 55 08             	mov    0x8(%ebp),%edx
c010056f:	89 50 10             	mov    %edx,0x10(%eax)
		lline = lfile;
c0100572:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100575:	89 45 d4             	mov    %eax,-0x2c(%ebp)
		rline = rfile;
c0100578:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010057b:	89 45 d0             	mov    %eax,-0x30(%ebp)
	}
	info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c010057e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100581:	8b 40 08             	mov    0x8(%eax),%eax
c0100584:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
c010058b:	00 
c010058c:	89 04 24             	mov    %eax,(%esp)
c010058f:	e8 e7 64 00 00       	call   c0106a7b <strfind>
c0100594:	89 c2                	mov    %eax,%edx
c0100596:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100599:	8b 40 08             	mov    0x8(%eax),%eax
c010059c:	29 c2                	sub    %eax,%edx
c010059e:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005a1:	89 50 0c             	mov    %edx,0xc(%eax)

	// Search within [lline, rline] for the line number stab.
	// If found, set info->eip_line to the right line number.
	// If not found, return -1.
	stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c01005a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01005a7:	89 44 24 10          	mov    %eax,0x10(%esp)
c01005ab:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
c01005b2:	00 
c01005b3:	8d 45 d0             	lea    -0x30(%ebp),%eax
c01005b6:	89 44 24 08          	mov    %eax,0x8(%esp)
c01005ba:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c01005bd:	89 44 24 04          	mov    %eax,0x4(%esp)
c01005c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01005c4:	89 04 24             	mov    %eax,(%esp)
c01005c7:	e8 ce fc ff ff       	call   c010029a <stab_binsearch>
	if (lline <= rline) {
c01005cc:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01005cf:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01005d2:	39 c2                	cmp    %eax,%edx
c01005d4:	7f 20                	jg     c01005f6 <debuginfo_eip+0x214>
		info->eip_line = stabs[rline].n_desc;
c01005d6:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01005d9:	89 c2                	mov    %eax,%edx
c01005db:	89 d0                	mov    %edx,%eax
c01005dd:	01 c0                	add    %eax,%eax
c01005df:	01 d0                	add    %edx,%eax
c01005e1:	c1 e0 02             	shl    $0x2,%eax
c01005e4:	03 45 f4             	add    -0xc(%ebp),%eax
c01005e7:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c01005eb:	0f b7 d0             	movzwl %ax,%edx
c01005ee:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005f1:	89 50 04             	mov    %edx,0x4(%eax)

	// Search backwards from the line number for the relevant filename stab.
	// We can't just use the "lfile" stab because inlined functions
	// can interpolate code from a different file!
	// Such included source files use the N_SOL stab type.
	while (lline >= lfile
c01005f4:	eb 13                	jmp    c0100609 <debuginfo_eip+0x227>
	// If not found, return -1.
	stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
	if (lline <= rline) {
		info->eip_line = stabs[rline].n_desc;
	} else {
		return -1;
c01005f6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01005fb:	e9 fc 00 00 00       	jmp    c01006fc <debuginfo_eip+0x31a>
	// can interpolate code from a different file!
	// Such included source files use the N_SOL stab type.
	while (lline >= lfile
	       && stabs[lline].n_type != N_SOL
	       && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
		lline --;
c0100600:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100603:	83 e8 01             	sub    $0x1,%eax
c0100606:	89 45 d4             	mov    %eax,-0x2c(%ebp)

	// Search backwards from the line number for the relevant filename stab.
	// We can't just use the "lfile" stab because inlined functions
	// can interpolate code from a different file!
	// Such included source files use the N_SOL stab type.
	while (lline >= lfile
c0100609:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010060c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010060f:	39 c2                	cmp    %eax,%edx
c0100611:	7c 4a                	jl     c010065d <debuginfo_eip+0x27b>
	       && stabs[lline].n_type != N_SOL
c0100613:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100616:	89 c2                	mov    %eax,%edx
c0100618:	89 d0                	mov    %edx,%eax
c010061a:	01 c0                	add    %eax,%eax
c010061c:	01 d0                	add    %edx,%eax
c010061e:	c1 e0 02             	shl    $0x2,%eax
c0100621:	03 45 f4             	add    -0xc(%ebp),%eax
c0100624:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100628:	3c 84                	cmp    $0x84,%al
c010062a:	74 31                	je     c010065d <debuginfo_eip+0x27b>
	       && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c010062c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010062f:	89 c2                	mov    %eax,%edx
c0100631:	89 d0                	mov    %edx,%eax
c0100633:	01 c0                	add    %eax,%eax
c0100635:	01 d0                	add    %edx,%eax
c0100637:	c1 e0 02             	shl    $0x2,%eax
c010063a:	03 45 f4             	add    -0xc(%ebp),%eax
c010063d:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100641:	3c 64                	cmp    $0x64,%al
c0100643:	75 bb                	jne    c0100600 <debuginfo_eip+0x21e>
c0100645:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100648:	89 c2                	mov    %eax,%edx
c010064a:	89 d0                	mov    %edx,%eax
c010064c:	01 c0                	add    %eax,%eax
c010064e:	01 d0                	add    %edx,%eax
c0100650:	c1 e0 02             	shl    $0x2,%eax
c0100653:	03 45 f4             	add    -0xc(%ebp),%eax
c0100656:	8b 40 08             	mov    0x8(%eax),%eax
c0100659:	85 c0                	test   %eax,%eax
c010065b:	74 a3                	je     c0100600 <debuginfo_eip+0x21e>
		lline --;
	}
	if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c010065d:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100660:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100663:	39 c2                	cmp    %eax,%edx
c0100665:	7c 40                	jl     c01006a7 <debuginfo_eip+0x2c5>
c0100667:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010066a:	89 c2                	mov    %eax,%edx
c010066c:	89 d0                	mov    %edx,%eax
c010066e:	01 c0                	add    %eax,%eax
c0100670:	01 d0                	add    %edx,%eax
c0100672:	c1 e0 02             	shl    $0x2,%eax
c0100675:	03 45 f4             	add    -0xc(%ebp),%eax
c0100678:	8b 10                	mov    (%eax),%edx
c010067a:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c010067d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100680:	89 cb                	mov    %ecx,%ebx
c0100682:	29 c3                	sub    %eax,%ebx
c0100684:	89 d8                	mov    %ebx,%eax
c0100686:	39 c2                	cmp    %eax,%edx
c0100688:	73 1d                	jae    c01006a7 <debuginfo_eip+0x2c5>
		info->eip_file = stabstr + stabs[lline].n_strx;
c010068a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010068d:	89 c2                	mov    %eax,%edx
c010068f:	89 d0                	mov    %edx,%eax
c0100691:	01 c0                	add    %eax,%eax
c0100693:	01 d0                	add    %edx,%eax
c0100695:	c1 e0 02             	shl    $0x2,%eax
c0100698:	03 45 f4             	add    -0xc(%ebp),%eax
c010069b:	8b 00                	mov    (%eax),%eax
c010069d:	89 c2                	mov    %eax,%edx
c010069f:	03 55 ec             	add    -0x14(%ebp),%edx
c01006a2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006a5:	89 10                	mov    %edx,(%eax)
	}

	// Set eip_fn_narg to the number of arguments taken by the function,
	// or 0 if there was no containing function.
	if (lfun < rfun) {
c01006a7:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01006aa:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01006ad:	39 c2                	cmp    %eax,%edx
c01006af:	7d 46                	jge    c01006f7 <debuginfo_eip+0x315>
		for (lline = lfun + 1;
c01006b1:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006b4:	83 c0 01             	add    $0x1,%eax
c01006b7:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c01006ba:	eb 18                	jmp    c01006d4 <debuginfo_eip+0x2f2>
		     lline < rfun && stabs[lline].n_type == N_PSYM;
		     lline ++) {
			info->eip_fn_narg ++;
c01006bc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006bf:	8b 40 14             	mov    0x14(%eax),%eax
c01006c2:	8d 50 01             	lea    0x1(%eax),%edx
c01006c5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006c8:	89 50 14             	mov    %edx,0x14(%eax)
	// Set eip_fn_narg to the number of arguments taken by the function,
	// or 0 if there was no containing function.
	if (lfun < rfun) {
		for (lline = lfun + 1;
		     lline < rfun && stabs[lline].n_type == N_PSYM;
		     lline ++) {
c01006cb:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01006ce:	83 c0 01             	add    $0x1,%eax
c01006d1:	89 45 d4             	mov    %eax,-0x2c(%ebp)

	// Set eip_fn_narg to the number of arguments taken by the function,
	// or 0 if there was no containing function.
	if (lfun < rfun) {
		for (lline = lfun + 1;
		     lline < rfun && stabs[lline].n_type == N_PSYM;
c01006d4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01006d7:	8b 45 d8             	mov    -0x28(%ebp),%eax
	}

	// Set eip_fn_narg to the number of arguments taken by the function,
	// or 0 if there was no containing function.
	if (lfun < rfun) {
		for (lline = lfun + 1;
c01006da:	39 c2                	cmp    %eax,%edx
c01006dc:	7d 19                	jge    c01006f7 <debuginfo_eip+0x315>
		     lline < rfun && stabs[lline].n_type == N_PSYM;
c01006de:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01006e1:	89 c2                	mov    %eax,%edx
c01006e3:	89 d0                	mov    %edx,%eax
c01006e5:	01 c0                	add    %eax,%eax
c01006e7:	01 d0                	add    %edx,%eax
c01006e9:	c1 e0 02             	shl    $0x2,%eax
c01006ec:	03 45 f4             	add    -0xc(%ebp),%eax
c01006ef:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01006f3:	3c a0                	cmp    $0xa0,%al
c01006f5:	74 c5                	je     c01006bc <debuginfo_eip+0x2da>
		     lline ++) {
			info->eip_fn_narg ++;
		}
	}
	return 0;
c01006f7:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01006fc:	83 c4 54             	add    $0x54,%esp
c01006ff:	5b                   	pop    %ebx
c0100700:	5d                   	pop    %ebp
c0100701:	c3                   	ret    

c0100702 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c0100702:	55                   	push   %ebp
c0100703:	89 e5                	mov    %esp,%ebp
c0100705:	83 ec 18             	sub    $0x18,%esp
	extern char etext[], edata[], end[], kern_init[];
	cprintf("Special kernel symbols:\n");
c0100708:	c7 04 24 ee 6d 10 c0 	movl   $0xc0106dee,(%esp)
c010070f:	e8 9c fa ff ff       	call   c01001b0 <cprintf>
	cprintf("  entry  0x%08x (phys)\n", kern_init);
c0100714:	c7 44 24 04 2c 00 10 	movl   $0xc010002c,0x4(%esp)
c010071b:	c0 
c010071c:	c7 04 24 07 6e 10 c0 	movl   $0xc0106e07,(%esp)
c0100723:	e8 88 fa ff ff       	call   c01001b0 <cprintf>
	cprintf("  etext  0x%08x (phys)\n", etext);
c0100728:	c7 44 24 04 bb 6d 10 	movl   $0xc0106dbb,0x4(%esp)
c010072f:	c0 
c0100730:	c7 04 24 1f 6e 10 c0 	movl   $0xc0106e1f,(%esp)
c0100737:	e8 74 fa ff ff       	call   c01001b0 <cprintf>
	cprintf("  edata  0x%08x (phys)\n", edata);
c010073c:	c7 44 24 04 98 aa 11 	movl   $0xc011aa98,0x4(%esp)
c0100743:	c0 
c0100744:	c7 04 24 37 6e 10 c0 	movl   $0xc0106e37,(%esp)
c010074b:	e8 60 fa ff ff       	call   c01001b0 <cprintf>
	cprintf("  end    0x%08x (phys)\n", end);
c0100750:	c7 44 24 04 9c ba 11 	movl   $0xc011ba9c,0x4(%esp)
c0100757:	c0 
c0100758:	c7 04 24 4f 6e 10 c0 	movl   $0xc0106e4f,(%esp)
c010075f:	e8 4c fa ff ff       	call   c01001b0 <cprintf>
	cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c0100764:	b8 2c 00 10 c0       	mov    $0xc010002c,%eax
c0100769:	89 c2                	mov    %eax,%edx
c010076b:	f7 da                	neg    %edx
c010076d:	b8 9c ba 11 c0       	mov    $0xc011ba9c,%eax
c0100772:	05 ff 03 00 00       	add    $0x3ff,%eax
c0100777:	8d 04 02             	lea    (%edx,%eax,1),%eax
c010077a:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c0100780:	85 c0                	test   %eax,%eax
c0100782:	0f 48 c2             	cmovs  %edx,%eax
c0100785:	c1 f8 0a             	sar    $0xa,%eax
c0100788:	89 44 24 04          	mov    %eax,0x4(%esp)
c010078c:	c7 04 24 68 6e 10 c0 	movl   $0xc0106e68,(%esp)
c0100793:	e8 18 fa ff ff       	call   c01001b0 <cprintf>
}
c0100798:	c9                   	leave  
c0100799:	c3                   	ret    

c010079a <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c010079a:	55                   	push   %ebp
c010079b:	89 e5                	mov    %esp,%ebp
c010079d:	81 ec 48 01 00 00    	sub    $0x148,%esp
	struct eipdebuginfo info;
	if (debuginfo_eip(eip, &info) != 0) {
c01007a3:	8d 45 dc             	lea    -0x24(%ebp),%eax
c01007a6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01007aa:	8b 45 08             	mov    0x8(%ebp),%eax
c01007ad:	89 04 24             	mov    %eax,(%esp)
c01007b0:	e8 2d fc ff ff       	call   c01003e2 <debuginfo_eip>
c01007b5:	85 c0                	test   %eax,%eax
c01007b7:	74 15                	je     c01007ce <print_debuginfo+0x34>
		cprintf("    <unknow>: -- 0x%08x --\n", eip);
c01007b9:	8b 45 08             	mov    0x8(%ebp),%eax
c01007bc:	89 44 24 04          	mov    %eax,0x4(%esp)
c01007c0:	c7 04 24 92 6e 10 c0 	movl   $0xc0106e92,(%esp)
c01007c7:	e8 e4 f9 ff ff       	call   c01001b0 <cprintf>
c01007cc:	eb 6a                	jmp    c0100838 <print_debuginfo+0x9e>
	}
	else {
		char fnname[256];
		int j;
		for (j = 0; j < info.eip_fn_namelen; j ++) {
c01007ce:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01007d5:	eb 1b                	jmp    c01007f2 <print_debuginfo+0x58>
			fnname[j] = info.eip_fn_name[j];
c01007d7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01007da:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007dd:	8d 04 02             	lea    (%edx,%eax,1),%eax
c01007e0:	0f b6 10             	movzbl (%eax),%edx
c01007e3:	8d 85 dc fe ff ff    	lea    -0x124(%ebp),%eax
c01007e9:	03 45 f4             	add    -0xc(%ebp),%eax
c01007ec:	88 10                	mov    %dl,(%eax)
		cprintf("    <unknow>: -- 0x%08x --\n", eip);
	}
	else {
		char fnname[256];
		int j;
		for (j = 0; j < info.eip_fn_namelen; j ++) {
c01007ee:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01007f2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01007f5:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01007f8:	7f dd                	jg     c01007d7 <print_debuginfo+0x3d>
			fnname[j] = info.eip_fn_name[j];
		}
		fnname[j] = '\0';
c01007fa:	8d 85 dc fe ff ff    	lea    -0x124(%ebp),%eax
c0100800:	03 45 f4             	add    -0xc(%ebp),%eax
c0100803:	c6 00 00             	movb   $0x0,(%eax)
		cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
				fnname, eip - info.eip_fn_addr);
c0100806:	8b 45 ec             	mov    -0x14(%ebp),%eax
		int j;
		for (j = 0; j < info.eip_fn_namelen; j ++) {
			fnname[j] = info.eip_fn_name[j];
		}
		fnname[j] = '\0';
		cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c0100809:	8b 55 08             	mov    0x8(%ebp),%edx
c010080c:	89 d1                	mov    %edx,%ecx
c010080e:	29 c1                	sub    %eax,%ecx
c0100810:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100813:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100816:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010081a:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100820:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c0100824:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100828:	89 44 24 04          	mov    %eax,0x4(%esp)
c010082c:	c7 04 24 ae 6e 10 c0 	movl   $0xc0106eae,(%esp)
c0100833:	e8 78 f9 ff ff       	call   c01001b0 <cprintf>
				fnname, eip - info.eip_fn_addr);
	}
}
c0100838:	c9                   	leave  
c0100839:	c3                   	ret    

c010083a <read_eip>:

static uint32_t read_eip(void) __attribute__((noinline));

static uint32_t
read_eip(void) {
c010083a:	55                   	push   %ebp
c010083b:	89 e5                	mov    %esp,%ebp
c010083d:	53                   	push   %ebx
c010083e:	83 ec 10             	sub    $0x10,%esp
	uint32_t eip;
	asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c0100841:	8b 5d 04             	mov    0x4(%ebp),%ebx
c0100844:	89 5d f8             	mov    %ebx,-0x8(%ebp)
	return eip;
c0100847:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c010084a:	83 c4 10             	add    $0x10,%esp
c010084d:	5b                   	pop    %ebx
c010084e:	5d                   	pop    %ebp
c010084f:	c3                   	ret    

c0100850 <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c0100850:	55                   	push   %ebp
c0100851:	89 e5                	mov    %esp,%ebp
	/* LAB1 2008010486 */
}
c0100853:	5d                   	pop    %ebp
c0100854:	c3                   	ret    

c0100855 <save_all_dr>:

static unsigned int local_dr_counter[MAX_DR_NUM];

/* save_all_dr - save all debug registers to memory and then disable them */
static void
save_all_dr(void) {
c0100855:	55                   	push   %ebp
c0100856:	89 e5                	mov    %esp,%ebp
c0100858:	53                   	push   %ebx
c0100859:	83 ec 30             	sub    $0x30,%esp
	int i;
	for (i = 0; i < MAX_DR_NUM; i ++) {
c010085c:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c0100863:	eb 63                	jmp    c01008c8 <save_all_dr+0x73>
		local_dr[i] = read_dr(i);
c0100865:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100868:	89 45 f0             	mov    %eax,-0x10(%ebp)
	asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
	uint32_t value = 0;
c010086b:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
	switch (regnum) {
c0100872:	83 7d f0 07          	cmpl   $0x7,-0x10(%ebp)
c0100876:	77 3d                	ja     c01008b5 <save_all_dr+0x60>
c0100878:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010087b:	c1 e0 02             	shl    $0x2,%eax
c010087e:	05 c0 6e 10 c0       	add    $0xc0106ec0,%eax
c0100883:	8b 00                	mov    (%eax),%eax
c0100885:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c0100887:	0f 21 c3             	mov    %db0,%ebx
c010088a:	89 5d ec             	mov    %ebx,-0x14(%ebp)
c010088d:	eb 26                	jmp    c01008b5 <save_all_dr+0x60>
	case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c010088f:	0f 21 cb             	mov    %db1,%ebx
c0100892:	89 5d ec             	mov    %ebx,-0x14(%ebp)
c0100895:	eb 1e                	jmp    c01008b5 <save_all_dr+0x60>
	case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c0100897:	0f 21 d3             	mov    %db2,%ebx
c010089a:	89 5d ec             	mov    %ebx,-0x14(%ebp)
c010089d:	eb 16                	jmp    c01008b5 <save_all_dr+0x60>
	case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c010089f:	0f 21 db             	mov    %db3,%ebx
c01008a2:	89 5d ec             	mov    %ebx,-0x14(%ebp)
c01008a5:	eb 0e                	jmp    c01008b5 <save_all_dr+0x60>
	case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c01008a7:	0f 21 f3             	mov    %db6,%ebx
c01008aa:	89 5d ec             	mov    %ebx,-0x14(%ebp)
c01008ad:	eb 06                	jmp    c01008b5 <save_all_dr+0x60>
	case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c01008af:	0f 21 fb             	mov    %db7,%ebx
c01008b2:	89 5d ec             	mov    %ebx,-0x14(%ebp)
	}
	return value;
c01008b5:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01008b8:	89 c2                	mov    %eax,%edx
c01008ba:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01008bd:	89 14 85 a0 ae 11 c0 	mov    %edx,-0x3fee5160(,%eax,4)

/* save_all_dr - save all debug registers to memory and then disable them */
static void
save_all_dr(void) {
	int i;
	for (i = 0; i < MAX_DR_NUM; i ++) {
c01008c4:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
c01008c8:	83 7d f8 03          	cmpl   $0x3,-0x8(%ebp)
c01008cc:	7e 97                	jle    c0100865 <save_all_dr+0x10>
c01008ce:	c7 45 e8 06 00 00 00 	movl   $0x6,-0x18(%ebp)
	asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
	uint32_t value = 0;
c01008d5:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
	switch (regnum) {
c01008dc:	83 7d e8 07          	cmpl   $0x7,-0x18(%ebp)
c01008e0:	77 3d                	ja     c010091f <save_all_dr+0xca>
c01008e2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01008e5:	c1 e0 02             	shl    $0x2,%eax
c01008e8:	05 e0 6e 10 c0       	add    $0xc0106ee0,%eax
c01008ed:	8b 00                	mov    (%eax),%eax
c01008ef:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c01008f1:	0f 21 c3             	mov    %db0,%ebx
c01008f4:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c01008f7:	eb 26                	jmp    c010091f <save_all_dr+0xca>
	case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c01008f9:	0f 21 cb             	mov    %db1,%ebx
c01008fc:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c01008ff:	eb 1e                	jmp    c010091f <save_all_dr+0xca>
	case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c0100901:	0f 21 d3             	mov    %db2,%ebx
c0100904:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c0100907:	eb 16                	jmp    c010091f <save_all_dr+0xca>
	case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c0100909:	0f 21 db             	mov    %db3,%ebx
c010090c:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c010090f:	eb 0e                	jmp    c010091f <save_all_dr+0xca>
	case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c0100911:	0f 21 f3             	mov    %db6,%ebx
c0100914:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c0100917:	eb 06                	jmp    c010091f <save_all_dr+0xca>
	case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c0100919:	0f 21 fb             	mov    %db7,%ebx
c010091c:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
	}
	return value;
c010091f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
		local_dr[i] = read_dr(i);
	}
	status_dr = read_dr(DR_STATUS);
c0100922:	a3 b0 ae 11 c0       	mov    %eax,0xc011aeb0
c0100927:	c7 45 e0 07 00 00 00 	movl   $0x7,-0x20(%ebp)
	asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
	uint32_t value = 0;
c010092e:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
	switch (regnum) {
c0100935:	83 7d e0 07          	cmpl   $0x7,-0x20(%ebp)
c0100939:	77 3d                	ja     c0100978 <save_all_dr+0x123>
c010093b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010093e:	c1 e0 02             	shl    $0x2,%eax
c0100941:	05 00 6f 10 c0       	add    $0xc0106f00,%eax
c0100946:	8b 00                	mov    (%eax),%eax
c0100948:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c010094a:	0f 21 c3             	mov    %db0,%ebx
c010094d:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0100950:	eb 26                	jmp    c0100978 <save_all_dr+0x123>
	case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c0100952:	0f 21 cb             	mov    %db1,%ebx
c0100955:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0100958:	eb 1e                	jmp    c0100978 <save_all_dr+0x123>
	case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c010095a:	0f 21 d3             	mov    %db2,%ebx
c010095d:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0100960:	eb 16                	jmp    c0100978 <save_all_dr+0x123>
	case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c0100962:	0f 21 db             	mov    %db3,%ebx
c0100965:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0100968:	eb 0e                	jmp    c0100978 <save_all_dr+0x123>
	case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c010096a:	0f 21 f3             	mov    %db6,%ebx
c010096d:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0100970:	eb 06                	jmp    c0100978 <save_all_dr+0x123>
	case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c0100972:	0f 21 fb             	mov    %db7,%ebx
c0100975:	89 5d dc             	mov    %ebx,-0x24(%ebp)
	}
	return value;
c0100978:	8b 45 dc             	mov    -0x24(%ebp),%eax
	control_dr = read_dr(DR_CONTROL);
c010097b:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
c0100980:	c7 45 d8 07 00 00 00 	movl   $0x7,-0x28(%ebp)
c0100987:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
}

static void
write_dr(unsigned regnum, uint32_t value) {
	switch (regnum) {
c010098e:	83 7d d8 07          	cmpl   $0x7,-0x28(%ebp)
c0100992:	77 3d                	ja     c01009d1 <save_all_dr+0x17c>
c0100994:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100997:	c1 e0 02             	shl    $0x2,%eax
c010099a:	05 20 6f 10 c0       	add    $0xc0106f20,%eax
c010099f:	8b 00                	mov    (%eax),%eax
c01009a1:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c01009a3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009a6:	0f 23 c0             	mov    %eax,%db0
c01009a9:	eb 26                	jmp    c01009d1 <save_all_dr+0x17c>
	case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c01009ab:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009ae:	0f 23 c8             	mov    %eax,%db1
c01009b1:	eb 1e                	jmp    c01009d1 <save_all_dr+0x17c>
	case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c01009b3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009b6:	0f 23 d0             	mov    %eax,%db2
c01009b9:	eb 16                	jmp    c01009d1 <save_all_dr+0x17c>
	case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c01009bb:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009be:	0f 23 d8             	mov    %eax,%db3
c01009c1:	eb 0e                	jmp    c01009d1 <save_all_dr+0x17c>
	case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c01009c3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009c6:	0f 23 f0             	mov    %eax,%db6
c01009c9:	eb 06                	jmp    c01009d1 <save_all_dr+0x17c>
	case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c01009cb:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01009ce:	0f 23 f8             	mov    %eax,%db7
	// disable breakpoints while debugger is running
	write_dr(DR_CONTROL, 0);

	// increase Debug Register Counter
	unsigned regnum;
	for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c01009d1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01009d8:	eb 38                	jmp    c0100a12 <save_all_dr+0x1bd>
		if (status_dr & (1 << regnum)) {
c01009da:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01009dd:	ba 01 00 00 00       	mov    $0x1,%edx
c01009e2:	89 d3                	mov    %edx,%ebx
c01009e4:	89 c1                	mov    %eax,%ecx
c01009e6:	d3 e3                	shl    %cl,%ebx
c01009e8:	89 d8                	mov    %ebx,%eax
c01009ea:	89 c2                	mov    %eax,%edx
c01009ec:	a1 b0 ae 11 c0       	mov    0xc011aeb0,%eax
c01009f1:	21 d0                	and    %edx,%eax
c01009f3:	85 c0                	test   %eax,%eax
c01009f5:	74 17                	je     c0100a0e <save_all_dr+0x1b9>
			local_dr_counter[regnum] ++;
c01009f7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01009fa:	8b 04 85 b8 ae 11 c0 	mov    -0x3fee5148(,%eax,4),%eax
c0100a01:	8d 50 01             	lea    0x1(%eax),%edx
c0100a04:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a07:	89 14 85 b8 ae 11 c0 	mov    %edx,-0x3fee5148(,%eax,4)
	// disable breakpoints while debugger is running
	write_dr(DR_CONTROL, 0);

	// increase Debug Register Counter
	unsigned regnum;
	for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100a0e:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0100a12:	83 7d f4 03          	cmpl   $0x3,-0xc(%ebp)
c0100a16:	76 c2                	jbe    c01009da <save_all_dr+0x185>
		if (status_dr & (1 << regnum)) {
			local_dr_counter[regnum] ++;
		}
	}
}
c0100a18:	83 c4 30             	add    $0x30,%esp
c0100a1b:	5b                   	pop    %ebx
c0100a1c:	5d                   	pop    %ebp
c0100a1d:	c3                   	ret    

c0100a1e <restore_all_dr>:

/* restore_all_dr - reset all debug registers and clear the status register DR6 */
static void
restore_all_dr(void) {
c0100a1e:	55                   	push   %ebp
c0100a1f:	89 e5                	mov    %esp,%ebp
c0100a21:	83 ec 20             	sub    $0x20,%esp
	int i;
	for (i = 0; i < MAX_DR_NUM; i ++) {
c0100a24:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0100a2b:	eb 5a                	jmp    c0100a87 <restore_all_dr+0x69>
		write_dr(i, local_dr[i]);
c0100a2d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100a30:	8b 04 85 a0 ae 11 c0 	mov    -0x3fee5160(,%eax,4),%eax
c0100a37:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100a3a:	89 55 f8             	mov    %edx,-0x8(%ebp)
c0100a3d:	89 45 f4             	mov    %eax,-0xc(%ebp)
	return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
	switch (regnum) {
c0100a40:	83 7d f8 07          	cmpl   $0x7,-0x8(%ebp)
c0100a44:	77 3d                	ja     c0100a83 <restore_all_dr+0x65>
c0100a46:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100a49:	c1 e0 02             	shl    $0x2,%eax
c0100a4c:	05 40 6f 10 c0       	add    $0xc0106f40,%eax
c0100a51:	8b 00                	mov    (%eax),%eax
c0100a53:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100a55:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a58:	0f 23 c0             	mov    %eax,%db0
c0100a5b:	eb 26                	jmp    c0100a83 <restore_all_dr+0x65>
	case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100a5d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a60:	0f 23 c8             	mov    %eax,%db1
c0100a63:	eb 1e                	jmp    c0100a83 <restore_all_dr+0x65>
	case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100a65:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a68:	0f 23 d0             	mov    %eax,%db2
c0100a6b:	eb 16                	jmp    c0100a83 <restore_all_dr+0x65>
	case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100a6d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a70:	0f 23 d8             	mov    %eax,%db3
c0100a73:	eb 0e                	jmp    c0100a83 <restore_all_dr+0x65>
	case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100a75:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a78:	0f 23 f0             	mov    %eax,%db6
c0100a7b:	eb 06                	jmp    c0100a83 <restore_all_dr+0x65>
	case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100a7d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a80:	0f 23 f8             	mov    %eax,%db7

/* restore_all_dr - reset all debug registers and clear the status register DR6 */
static void
restore_all_dr(void) {
	int i;
	for (i = 0; i < MAX_DR_NUM; i ++) {
c0100a83:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0100a87:	83 7d fc 03          	cmpl   $0x3,-0x4(%ebp)
c0100a8b:	7e a0                	jle    c0100a2d <restore_all_dr+0xf>
c0100a8d:	c7 45 f0 06 00 00 00 	movl   $0x6,-0x10(%ebp)
c0100a94:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
	return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
	switch (regnum) {
c0100a9b:	83 7d f0 07          	cmpl   $0x7,-0x10(%ebp)
c0100a9f:	77 3d                	ja     c0100ade <restore_all_dr+0xc0>
c0100aa1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100aa4:	c1 e0 02             	shl    $0x2,%eax
c0100aa7:	05 60 6f 10 c0       	add    $0xc0106f60,%eax
c0100aac:	8b 00                	mov    (%eax),%eax
c0100aae:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100ab0:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100ab3:	0f 23 c0             	mov    %eax,%db0
c0100ab6:	eb 26                	jmp    c0100ade <restore_all_dr+0xc0>
	case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100ab8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100abb:	0f 23 c8             	mov    %eax,%db1
c0100abe:	eb 1e                	jmp    c0100ade <restore_all_dr+0xc0>
	case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100ac0:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100ac3:	0f 23 d0             	mov    %eax,%db2
c0100ac6:	eb 16                	jmp    c0100ade <restore_all_dr+0xc0>
	case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100ac8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100acb:	0f 23 d8             	mov    %eax,%db3
c0100ace:	eb 0e                	jmp    c0100ade <restore_all_dr+0xc0>
	case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100ad0:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100ad3:	0f 23 f0             	mov    %eax,%db6
c0100ad6:	eb 06                	jmp    c0100ade <restore_all_dr+0xc0>
	case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100ad8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100adb:	0f 23 f8             	mov    %eax,%db7
		write_dr(i, local_dr[i]);
	}
	write_dr(DR_STATUS, 0);
	write_dr(DR_CONTROL, control_dr);
c0100ade:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100ae3:	c7 45 e8 07 00 00 00 	movl   $0x7,-0x18(%ebp)
c0100aea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
	switch (regnum) {
c0100aed:	83 7d e8 07          	cmpl   $0x7,-0x18(%ebp)
c0100af1:	77 3d                	ja     c0100b30 <restore_all_dr+0x112>
c0100af3:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100af6:	c1 e0 02             	shl    $0x2,%eax
c0100af9:	05 80 6f 10 c0       	add    $0xc0106f80,%eax
c0100afe:	8b 00                	mov    (%eax),%eax
c0100b00:	ff e0                	jmp    *%eax
	case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100b02:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b05:	0f 23 c0             	mov    %eax,%db0
c0100b08:	eb 26                	jmp    c0100b30 <restore_all_dr+0x112>
	case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100b0a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b0d:	0f 23 c8             	mov    %eax,%db1
c0100b10:	eb 1e                	jmp    c0100b30 <restore_all_dr+0x112>
	case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100b12:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b15:	0f 23 d0             	mov    %eax,%db2
c0100b18:	eb 16                	jmp    c0100b30 <restore_all_dr+0x112>
	case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100b1a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b1d:	0f 23 d8             	mov    %eax,%db3
c0100b20:	eb 0e                	jmp    c0100b30 <restore_all_dr+0x112>
	case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100b22:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b25:	0f 23 f0             	mov    %eax,%db6
c0100b28:	eb 06                	jmp    c0100b30 <restore_all_dr+0x112>
	case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100b2a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100b2d:	0f 23 f8             	mov    %eax,%db7
}
c0100b30:	c9                   	leave  
c0100b31:	c3                   	ret    

c0100b32 <debug_enable_dr>:

/* debug_enable_dr - set and enable debug register @regnum locally */
int
debug_enable_dr(unsigned regnum, uintptr_t addr, unsigned type, unsigned len) {
c0100b32:	55                   	push   %ebp
c0100b33:	89 e5                	mov    %esp,%ebp
c0100b35:	53                   	push   %ebx
c0100b36:	83 ec 10             	sub    $0x10,%esp
	if (regnum < MAX_DR_NUM) {
c0100b39:	83 7d 08 03          	cmpl   $0x3,0x8(%ebp)
c0100b3d:	0f 87 ad 00 00 00    	ja     c0100bf0 <debug_enable_dr+0xbe>
		local_dr[regnum] = addr;
c0100b43:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b46:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100b49:	89 14 85 a0 ae 11 c0 	mov    %edx,-0x3fee5160(,%eax,4)
		local_dr_counter[regnum] = 0;
c0100b50:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b53:	c7 04 85 b8 ae 11 c0 	movl   $0x0,-0x3fee5148(,%eax,4)
c0100b5a:	00 00 00 00 
		unsigned shift = (regnum * 4) + 16;
c0100b5e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b61:	83 c0 04             	add    $0x4,%eax
c0100b64:	c1 e0 02             	shl    $0x2,%eax
c0100b67:	89 45 f8             	mov    %eax,-0x8(%ebp)
		uint32_t mask = (0xF << shift);
c0100b6a:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100b6d:	ba 0f 00 00 00       	mov    $0xf,%edx
c0100b72:	89 d3                	mov    %edx,%ebx
c0100b74:	89 c1                	mov    %eax,%ecx
c0100b76:	d3 e3                	shl    %cl,%ebx
c0100b78:	89 d8                	mov    %ebx,%eax
c0100b7a:	89 45 f4             	mov    %eax,-0xc(%ebp)
		control_dr &= ~mask;
c0100b7d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b80:	89 c2                	mov    %eax,%edx
c0100b82:	f7 d2                	not    %edx
c0100b84:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100b89:	21 d0                	and    %edx,%eax
c0100b8b:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		control_dr |= ((type & 3) << shift);
c0100b90:	8b 45 10             	mov    0x10(%ebp),%eax
c0100b93:	89 c2                	mov    %eax,%edx
c0100b95:	83 e2 03             	and    $0x3,%edx
c0100b98:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100b9b:	89 c1                	mov    %eax,%ecx
c0100b9d:	d3 e2                	shl    %cl,%edx
c0100b9f:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100ba4:	09 d0                	or     %edx,%eax
c0100ba6:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		control_dr |= ((len & 3) << (shift + 2));
c0100bab:	8b 45 14             	mov    0x14(%ebp),%eax
c0100bae:	89 c2                	mov    %eax,%edx
c0100bb0:	83 e2 03             	and    $0x3,%edx
c0100bb3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100bb6:	83 c0 02             	add    $0x2,%eax
c0100bb9:	89 c1                	mov    %eax,%ecx
c0100bbb:	d3 e2                	shl    %cl,%edx
c0100bbd:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100bc2:	09 d0                	or     %edx,%eax
c0100bc4:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		control_dr |= (1 << (regnum * 2));
c0100bc9:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bcc:	01 c0                	add    %eax,%eax
c0100bce:	ba 01 00 00 00       	mov    $0x1,%edx
c0100bd3:	89 d3                	mov    %edx,%ebx
c0100bd5:	89 c1                	mov    %eax,%ecx
c0100bd7:	d3 e3                	shl    %cl,%ebx
c0100bd9:	89 d8                	mov    %ebx,%eax
c0100bdb:	89 c2                	mov    %eax,%edx
c0100bdd:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100be2:	09 d0                	or     %edx,%eax
c0100be4:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		return 0;
c0100be9:	b8 00 00 00 00       	mov    $0x0,%eax
c0100bee:	eb 05                	jmp    c0100bf5 <debug_enable_dr+0xc3>
	}
	return -1;
c0100bf0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c0100bf5:	83 c4 10             	add    $0x10,%esp
c0100bf8:	5b                   	pop    %ebx
c0100bf9:	5d                   	pop    %ebp
c0100bfa:	c3                   	ret    

c0100bfb <debug_disable_dr>:

/* debug_disable_dr - disable debug register @regnum locally */
int
debug_disable_dr(unsigned regnum) {
c0100bfb:	55                   	push   %ebp
c0100bfc:	89 e5                	mov    %esp,%ebp
c0100bfe:	53                   	push   %ebx
c0100bff:	83 ec 10             	sub    $0x10,%esp
	if (regnum < MAX_DR_NUM) {
c0100c02:	83 7d 08 03          	cmpl   $0x3,0x8(%ebp)
c0100c06:	77 5b                	ja     c0100c63 <debug_disable_dr+0x68>
		unsigned shift = (regnum * 4) + 16;
c0100c08:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c0b:	83 c0 04             	add    $0x4,%eax
c0100c0e:	c1 e0 02             	shl    $0x2,%eax
c0100c11:	89 45 f8             	mov    %eax,-0x8(%ebp)
		uint32_t mask = (0xF << shift);
c0100c14:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100c17:	ba 0f 00 00 00       	mov    $0xf,%edx
c0100c1c:	89 d3                	mov    %edx,%ebx
c0100c1e:	89 c1                	mov    %eax,%ecx
c0100c20:	d3 e3                	shl    %cl,%ebx
c0100c22:	89 d8                	mov    %ebx,%eax
c0100c24:	89 45 f4             	mov    %eax,-0xc(%ebp)
		control_dr &= ~mask;
c0100c27:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c2a:	89 c2                	mov    %eax,%edx
c0100c2c:	f7 d2                	not    %edx
c0100c2e:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100c33:	21 d0                	and    %edx,%eax
c0100c35:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		control_dr &= ~(1 << (regnum * 2));
c0100c3a:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c3d:	01 c0                	add    %eax,%eax
c0100c3f:	ba 01 00 00 00       	mov    $0x1,%edx
c0100c44:	89 d3                	mov    %edx,%ebx
c0100c46:	89 c1                	mov    %eax,%ecx
c0100c48:	d3 e3                	shl    %cl,%ebx
c0100c4a:	89 d8                	mov    %ebx,%eax
c0100c4c:	f7 d0                	not    %eax
c0100c4e:	89 c2                	mov    %eax,%edx
c0100c50:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100c55:	21 d0                	and    %edx,%eax
c0100c57:	a3 b4 ae 11 c0       	mov    %eax,0xc011aeb4
		return 0;
c0100c5c:	b8 00 00 00 00       	mov    $0x0,%eax
c0100c61:	eb 05                	jmp    c0100c68 <debug_disable_dr+0x6d>
	}
	return -1;
c0100c63:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c0100c68:	83 c4 10             	add    $0x10,%esp
c0100c6b:	5b                   	pop    %ebx
c0100c6c:	5d                   	pop    %ebp
c0100c6d:	c3                   	ret    

c0100c6e <debug_init>:
// mark if local_dr, status_dr and contorl_dr are valid
static bool is_dr_saved = 0;

/* debug_init - init all debug registers by using restore_dr */
void
debug_init(void) {
c0100c6e:	55                   	push   %ebp
c0100c6f:	89 e5                	mov    %esp,%ebp
c0100c71:	83 ec 18             	sub    $0x18,%esp
	memset(local_dr, 0, sizeof(local_dr));
c0100c74:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0100c7b:	00 
c0100c7c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100c83:	00 
c0100c84:	c7 04 24 a0 ae 11 c0 	movl   $0xc011aea0,(%esp)
c0100c8b:	e8 73 5f 00 00       	call   c0106c03 <memset>
	memset(local_dr_counter, 0, sizeof(local_dr_counter));
c0100c90:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0100c97:	00 
c0100c98:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100c9f:	00 
c0100ca0:	c7 04 24 b8 ae 11 c0 	movl   $0xc011aeb8,(%esp)
c0100ca7:	e8 57 5f 00 00       	call   c0106c03 <memset>
	control_dr = DR7_GEXACT | DR7_LEXACT;
c0100cac:	c7 05 b4 ae 11 c0 00 	movl   $0x300,0xc011aeb4
c0100cb3:	03 00 00 
	restore_all_dr();
c0100cb6:	e8 63 fd ff ff       	call   c0100a1e <restore_all_dr>
}
c0100cbb:	c9                   	leave  
c0100cbc:	c3                   	ret    

c0100cbd <debug_list_dr>:

/* debug_list_dr - list and print all debug registrs' value and type */
void
debug_list_dr(void) {
c0100cbd:	55                   	push   %ebp
c0100cbe:	89 e5                	mov    %esp,%ebp
c0100cc0:	53                   	push   %ebx
c0100cc1:	83 ec 44             	sub    $0x44,%esp
	bool has = 0;
c0100cc4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	int regnum;
	for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100ccb:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0100cd2:	e9 c8 00 00 00       	jmp    c0100d9f <debug_list_dr+0xe2>
		if (control_dr & (1 << (regnum * 2))) {
c0100cd7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100cda:	01 c0                	add    %eax,%eax
c0100cdc:	ba 01 00 00 00       	mov    $0x1,%edx
c0100ce1:	89 d3                	mov    %edx,%ebx
c0100ce3:	89 c1                	mov    %eax,%ecx
c0100ce5:	d3 e3                	shl    %cl,%ebx
c0100ce7:	89 d8                	mov    %ebx,%eax
c0100ce9:	89 c2                	mov    %eax,%edx
c0100ceb:	a1 b4 ae 11 c0       	mov    0xc011aeb4,%eax
c0100cf0:	21 d0                	and    %edx,%eax
c0100cf2:	85 c0                	test   %eax,%eax
c0100cf4:	0f 84 a1 00 00 00    	je     c0100d9b <debug_list_dr+0xde>
			if (!has) {
c0100cfa:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100cfe:	75 13                	jne    c0100d13 <debug_list_dr+0x56>
				has = 1;
c0100d00:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
				cprintf("    Num Address    Type       Len    Count\n");
c0100d07:	c7 04 24 dc 6f 10 c0 	movl   $0xc0106fdc,(%esp)
c0100d0e:	e8 9d f4 ff ff       	call   c01001b0 <cprintf>
			}
			unsigned shift = (regnum * 4) + 16;
c0100d13:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100d16:	83 c0 04             	add    $0x4,%eax
c0100d19:	c1 e0 02             	shl    $0x2,%eax
c0100d1c:	89 45 ec             	mov    %eax,-0x14(%ebp)
			unsigned type = ((control_dr >> shift) & 3);
c0100d1f:	8b 15 b4 ae 11 c0    	mov    0xc011aeb4,%edx
c0100d25:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100d28:	89 d3                	mov    %edx,%ebx
c0100d2a:	89 c1                	mov    %eax,%ecx
c0100d2c:	d3 eb                	shr    %cl,%ebx
c0100d2e:	89 d8                	mov    %ebx,%eax
c0100d30:	83 e0 03             	and    $0x3,%eax
c0100d33:	89 45 e8             	mov    %eax,-0x18(%ebp)
			unsigned len = ((control_dr >> (shift + 2)) & 3);
c0100d36:	8b 15 b4 ae 11 c0    	mov    0xc011aeb4,%edx
c0100d3c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100d3f:	83 c0 02             	add    $0x2,%eax
c0100d42:	89 d3                	mov    %edx,%ebx
c0100d44:	89 c1                	mov    %eax,%ecx
c0100d46:	d3 eb                	shr    %cl,%ebx
c0100d48:	89 d8                	mov    %ebx,%eax
c0100d4a:	83 e0 03             	and    $0x3,%eax
c0100d4d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
			cprintf("    %1d   0x%08x %-10s %6s %d\n", regnum, local_dr[regnum],
c0100d50:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100d53:	8b 1c 85 b8 ae 11 c0 	mov    -0x3fee5148(,%eax,4),%ebx
c0100d5a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100d5d:	8b 0c 85 30 a0 11 c0 	mov    -0x3fee5fd0(,%eax,4),%ecx
c0100d64:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100d67:	8b 14 85 20 a0 11 c0 	mov    -0x3fee5fe0(,%eax,4),%edx
c0100d6e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100d71:	8b 04 85 a0 ae 11 c0 	mov    -0x3fee5160(,%eax,4),%eax
c0100d78:	89 5c 24 14          	mov    %ebx,0x14(%esp)
c0100d7c:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c0100d80:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0100d84:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100d88:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100d8b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d8f:	c7 04 24 08 70 10 c0 	movl   $0xc0107008,(%esp)
c0100d96:	e8 15 f4 ff ff       	call   c01001b0 <cprintf>
/* debug_list_dr - list and print all debug registrs' value and type */
void
debug_list_dr(void) {
	bool has = 0;
	int regnum;
	for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100d9b:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
c0100d9f:	83 7d f0 03          	cmpl   $0x3,-0x10(%ebp)
c0100da3:	0f 8e 2e ff ff ff    	jle    c0100cd7 <debug_list_dr+0x1a>
			unsigned len = ((control_dr >> (shift + 2)) & 3);
			cprintf("    %1d   0x%08x %-10s %6s %d\n", regnum, local_dr[regnum],
					BreakDescription[type], BreakLengthDescription[len], local_dr_counter[regnum]);
		}
	}
	if (!has) {
c0100da9:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100dad:	75 0c                	jne    c0100dbb <debug_list_dr+0xfe>
		cprintf("no breakpoints or watchpoints.\n");
c0100daf:	c7 04 24 28 70 10 c0 	movl   $0xc0107028,(%esp)
c0100db6:	e8 f5 f3 ff ff       	call   c01001b0 <cprintf>
	}
}
c0100dbb:	83 c4 44             	add    $0x44,%esp
c0100dbe:	5b                   	pop    %ebx
c0100dbf:	5d                   	pop    %ebp
c0100dc0:	c3                   	ret    

c0100dc1 <debug_start>:
 * type 'step' to decide to run a single step, debug_end won't restore all these
 * debug registers, and keep the value of 'is_dr_saved'. When another debug interrupt
 * occurs, it may go into this function again.
 * */
static void
debug_start(struct trapframe *tf) {
c0100dc1:	55                   	push   %ebp
c0100dc2:	89 e5                	mov    %esp,%ebp
	if (!is_dr_saved) {
c0100dc4:	a1 c8 ae 11 c0       	mov    0xc011aec8,%eax
c0100dc9:	85 c0                	test   %eax,%eax
c0100dcb:	75 0f                	jne    c0100ddc <debug_start+0x1b>
		is_dr_saved = 1;
c0100dcd:	c7 05 c8 ae 11 c0 01 	movl   $0x1,0xc011aec8
c0100dd4:	00 00 00 
		save_all_dr();
c0100dd7:	e8 79 fa ff ff       	call   c0100855 <save_all_dr>
	}
}
c0100ddc:	5d                   	pop    %ebp
c0100ddd:	c3                   	ret    

c0100dde <debug_end>:
/* *
 * debug_end - restore all debug registers if necessory. Note that, if kernel
 * needs to run a single step, it should not restore them.
 * */
static void
debug_end(struct trapframe *tf) {
c0100dde:	55                   	push   %ebp
c0100ddf:	89 e5                	mov    %esp,%ebp
	if (!(tf->tf_eflags & FL_TF) && is_dr_saved) {
c0100de1:	8b 45 08             	mov    0x8(%ebp),%eax
c0100de4:	8b 40 38             	mov    0x38(%eax),%eax
c0100de7:	25 00 01 00 00       	and    $0x100,%eax
c0100dec:	85 c0                	test   %eax,%eax
c0100dee:	75 18                	jne    c0100e08 <debug_end+0x2a>
c0100df0:	a1 c8 ae 11 c0       	mov    0xc011aec8,%eax
c0100df5:	85 c0                	test   %eax,%eax
c0100df7:	74 0f                	je     c0100e08 <debug_end+0x2a>
		is_dr_saved = 0;
c0100df9:	c7 05 c8 ae 11 c0 00 	movl   $0x0,0xc011aec8
c0100e00:	00 00 00 
		restore_all_dr();
c0100e03:	e8 16 fc ff ff       	call   c0100a1e <restore_all_dr>
	}
}
c0100e08:	5d                   	pop    %ebp
c0100e09:	c3                   	ret    

c0100e0a <debug_monitor>:

/* debug_monitor - goes into the debugger monitor, and type 'continue' to return */
void
debug_monitor(struct trapframe *tf) {
c0100e0a:	55                   	push   %ebp
c0100e0b:	89 e5                	mov    %esp,%ebp
c0100e0d:	83 ec 28             	sub    $0x28,%esp
	assert(tf != NULL);
c0100e10:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100e14:	75 24                	jne    c0100e3a <debug_monitor+0x30>
c0100e16:	c7 44 24 0c 48 70 10 	movl   $0xc0107048,0xc(%esp)
c0100e1d:	c0 
c0100e1e:	c7 44 24 08 53 70 10 	movl   $0xc0107053,0x8(%esp)
c0100e25:	c0 
c0100e26:	c7 44 24 04 b7 01 00 	movl   $0x1b7,0x4(%esp)
c0100e2d:	00 
c0100e2e:	c7 04 24 68 70 10 c0 	movl   $0xc0107068,(%esp)
c0100e35:	e8 ca 07 00 00       	call   c0101604 <__panic>
	bool intr_flag;
	local_intr_save(intr_flag);
c0100e3a:	e8 19 f4 ff ff       	call   c0100258 <__intr_save>
c0100e3f:	89 45 f4             	mov    %eax,-0xc(%ebp)
	{
		debug_start(tf);
c0100e42:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e45:	89 04 24             	mov    %eax,(%esp)
c0100e48:	e8 74 ff ff ff       	call   c0100dc1 <debug_start>
		cprintf("debug_monitor at:\n");
c0100e4d:	c7 04 24 7c 70 10 c0 	movl   $0xc010707c,(%esp)
c0100e54:	e8 57 f3 ff ff       	call   c01001b0 <cprintf>
		print_debuginfo(tf->tf_eip);
c0100e59:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e5c:	8b 40 30             	mov    0x30(%eax),%eax
c0100e5f:	89 04 24             	mov    %eax,(%esp)
c0100e62:	e8 33 f9 ff ff       	call   c010079a <print_debuginfo>
		monitor(tf);
c0100e67:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e6a:	89 04 24             	mov    %eax,(%esp)
c0100e6d:	e8 7a 01 00 00       	call   c0100fec <monitor>
		debug_end(tf);
c0100e72:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e75:	89 04 24             	mov    %eax,(%esp)
c0100e78:	e8 61 ff ff ff       	call   c0100dde <debug_end>
	}
	local_intr_restore(intr_flag);
c0100e7d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100e80:	89 04 24             	mov    %eax,(%esp)
c0100e83:	e8 ff f3 ff ff       	call   c0100287 <__intr_restore>
}
c0100e88:	c9                   	leave  
c0100e89:	c3                   	ret    
	...

c0100e8c <parse>:
#define MAXARGS			16
#define WHITESPACE		" \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c0100e8c:	55                   	push   %ebp
c0100e8d:	89 e5                	mov    %esp,%ebp
c0100e8f:	83 ec 28             	sub    $0x28,%esp
	int argc = 0;
c0100e92:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	while (1) {
		// find global whitespace
		while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100e99:	eb 0a                	jmp    c0100ea5 <parse+0x19>
			*buf ++ = '\0';
c0100e9b:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e9e:	c6 00 00             	movb   $0x0,(%eax)
c0100ea1:	83 45 08 01          	addl   $0x1,0x8(%ebp)
static int
parse(char *buf, char **argv) {
	int argc = 0;
	while (1) {
		// find global whitespace
		while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100ea5:	8b 45 08             	mov    0x8(%ebp),%eax
c0100ea8:	0f b6 00             	movzbl (%eax),%eax
c0100eab:	84 c0                	test   %al,%al
c0100ead:	74 1d                	je     c0100ecc <parse+0x40>
c0100eaf:	8b 45 08             	mov    0x8(%ebp),%eax
c0100eb2:	0f b6 00             	movzbl (%eax),%eax
c0100eb5:	0f be c0             	movsbl %al,%eax
c0100eb8:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100ebc:	c7 04 24 bd 73 10 c0 	movl   $0xc01073bd,(%esp)
c0100ec3:	e8 80 5b 00 00       	call   c0106a48 <strchr>
c0100ec8:	85 c0                	test   %eax,%eax
c0100eca:	75 cf                	jne    c0100e9b <parse+0xf>
			*buf ++ = '\0';
		}
		if (*buf == '\0') {
c0100ecc:	8b 45 08             	mov    0x8(%ebp),%eax
c0100ecf:	0f b6 00             	movzbl (%eax),%eax
c0100ed2:	84 c0                	test   %al,%al
c0100ed4:	75 05                	jne    c0100edb <parse+0x4f>
		argv[argc ++] = buf;
		while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
			buf ++;
		}
	}
	return argc;
c0100ed6:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100ed9:	c9                   	leave  
c0100eda:	c3                   	ret    
		if (*buf == '\0') {
			break;
		}

		// save and scan past next arg
		if (argc == MAXARGS - 1) {
c0100edb:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100edf:	75 14                	jne    c0100ef5 <parse+0x69>
			cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100ee1:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
c0100ee8:	00 
c0100ee9:	c7 04 24 c2 73 10 c0 	movl   $0xc01073c2,(%esp)
c0100ef0:	e8 bb f2 ff ff       	call   c01001b0 <cprintf>
		}
		argv[argc ++] = buf;
c0100ef5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100ef8:	c1 e0 02             	shl    $0x2,%eax
c0100efb:	03 45 0c             	add    0xc(%ebp),%eax
c0100efe:	8b 55 08             	mov    0x8(%ebp),%edx
c0100f01:	89 10                	mov    %edx,(%eax)
c0100f03:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
		while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100f07:	eb 04                	jmp    c0100f0d <parse+0x81>
			buf ++;
c0100f09:	83 45 08 01          	addl   $0x1,0x8(%ebp)
		// save and scan past next arg
		if (argc == MAXARGS - 1) {
			cprintf("Too many arguments (max %d).\n", MAXARGS);
		}
		argv[argc ++] = buf;
		while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100f0d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f10:	0f b6 00             	movzbl (%eax),%eax
c0100f13:	84 c0                	test   %al,%al
c0100f15:	74 1d                	je     c0100f34 <parse+0xa8>
c0100f17:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f1a:	0f b6 00             	movzbl (%eax),%eax
c0100f1d:	0f be c0             	movsbl %al,%eax
c0100f20:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100f24:	c7 04 24 bd 73 10 c0 	movl   $0xc01073bd,(%esp)
c0100f2b:	e8 18 5b 00 00       	call   c0106a48 <strchr>
c0100f30:	85 c0                	test   %eax,%eax
c0100f32:	74 d5                	je     c0100f09 <parse+0x7d>
			buf ++;
		}
	}
c0100f34:	90                   	nop
static int
parse(char *buf, char **argv) {
	int argc = 0;
	while (1) {
		// find global whitespace
		while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100f35:	e9 6b ff ff ff       	jmp    c0100ea5 <parse+0x19>

c0100f3a <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100f3a:	55                   	push   %ebp
c0100f3b:	89 e5                	mov    %esp,%ebp
c0100f3d:	83 ec 68             	sub    $0x68,%esp
	char *argv[MAXARGS];
	int argc = parse(buf, argv);
c0100f40:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100f43:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100f47:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f4a:	89 04 24             	mov    %eax,(%esp)
c0100f4d:	e8 3a ff ff ff       	call   c0100e8c <parse>
c0100f52:	89 45 f0             	mov    %eax,-0x10(%ebp)
	if (argc == 0) {
c0100f55:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100f59:	75 0a                	jne    c0100f65 <runcmd+0x2b>
		return 0;
c0100f5b:	b8 00 00 00 00       	mov    $0x0,%eax
c0100f60:	e9 85 00 00 00       	jmp    c0100fea <runcmd+0xb0>
	}
	int i;
	for (i = 0; i < NCOMMANDS; i ++) {
c0100f65:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100f6c:	eb 5c                	jmp    c0100fca <runcmd+0x90>
		if (strcmp(commands[i].name, argv[0]) == 0) {
c0100f6e:	8b 4d b0             	mov    -0x50(%ebp),%ecx
c0100f71:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100f74:	89 d0                	mov    %edx,%eax
c0100f76:	01 c0                	add    %eax,%eax
c0100f78:	01 d0                	add    %edx,%eax
c0100f7a:	c1 e0 02             	shl    $0x2,%eax
c0100f7d:	05 40 a0 11 c0       	add    $0xc011a040,%eax
c0100f82:	8b 00                	mov    (%eax),%eax
c0100f84:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c0100f88:	89 04 24             	mov    %eax,(%esp)
c0100f8b:	e8 13 5a 00 00       	call   c01069a3 <strcmp>
c0100f90:	85 c0                	test   %eax,%eax
c0100f92:	75 32                	jne    c0100fc6 <runcmd+0x8c>
			return commands[i].func(argc - 1, argv + 1, tf);
c0100f94:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100f97:	89 d0                	mov    %edx,%eax
c0100f99:	01 c0                	add    %eax,%eax
c0100f9b:	01 d0                	add    %edx,%eax
c0100f9d:	c1 e0 02             	shl    $0x2,%eax
c0100fa0:	05 40 a0 11 c0       	add    $0xc011a040,%eax
c0100fa5:	8b 50 08             	mov    0x8(%eax),%edx
c0100fa8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100fab:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0100fae:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100fb1:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100fb5:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100fb8:	83 c0 04             	add    $0x4,%eax
c0100fbb:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100fbf:	89 0c 24             	mov    %ecx,(%esp)
c0100fc2:	ff d2                	call   *%edx
c0100fc4:	eb 24                	jmp    c0100fea <runcmd+0xb0>
	int argc = parse(buf, argv);
	if (argc == 0) {
		return 0;
	}
	int i;
	for (i = 0; i < NCOMMANDS; i ++) {
c0100fc6:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0100fca:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100fcd:	83 f8 08             	cmp    $0x8,%eax
c0100fd0:	76 9c                	jbe    c0100f6e <runcmd+0x34>
		if (strcmp(commands[i].name, argv[0]) == 0) {
			return commands[i].func(argc - 1, argv + 1, tf);
		}
	}
	cprintf("Unknown command '%s'\n", argv[0]);
c0100fd2:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0100fd5:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100fd9:	c7 04 24 e0 73 10 c0 	movl   $0xc01073e0,(%esp)
c0100fe0:	e8 cb f1 ff ff       	call   c01001b0 <cprintf>
	return 0;
c0100fe5:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100fea:	c9                   	leave  
c0100feb:	c3                   	ret    

c0100fec <monitor>:

/***** Implementations of basic kernel monitor commands *****/

void
monitor(struct trapframe *tf) {
c0100fec:	55                   	push   %ebp
c0100fed:	89 e5                	mov    %esp,%ebp
c0100fef:	83 ec 28             	sub    $0x28,%esp
	cprintf("Welcome to the kernel debug monitor!!\n");
c0100ff2:	c7 04 24 f8 73 10 c0 	movl   $0xc01073f8,(%esp)
c0100ff9:	e8 b2 f1 ff ff       	call   c01001b0 <cprintf>
	cprintf("Type 'help' for a list of commands.\n");
c0100ffe:	c7 04 24 20 74 10 c0 	movl   $0xc0107420,(%esp)
c0101005:	e8 a6 f1 ff ff       	call   c01001b0 <cprintf>

	if (tf != NULL) {
c010100a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010100e:	74 11                	je     c0101021 <monitor+0x35>
		print_trapframe(tf);
c0101010:	8b 45 08             	mov    0x8(%ebp),%eax
c0101013:	89 04 24             	mov    %eax,(%esp)
c0101016:	e8 a2 13 00 00       	call   c01023bd <print_trapframe>
c010101b:	eb 04                	jmp    c0101021 <monitor+0x35>
		if ((buf = readline("K> ")) != NULL) {
			if (runcmd(buf, tf) < 0) {
				break;
			}
		}
	}
c010101d:	90                   	nop
c010101e:	eb 01                	jmp    c0101021 <monitor+0x35>
c0101020:	90                   	nop
		print_trapframe(tf);
	}

	char *buf;
	while (1) {
		if ((buf = readline("K> ")) != NULL) {
c0101021:	c7 04 24 45 74 10 c0 	movl   $0xc0107445,(%esp)
c0101028:	e8 73 f0 ff ff       	call   c01000a0 <readline>
c010102d:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101030:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101034:	74 e7                	je     c010101d <monitor+0x31>
			if (runcmd(buf, tf) < 0) {
c0101036:	8b 45 08             	mov    0x8(%ebp),%eax
c0101039:	89 44 24 04          	mov    %eax,0x4(%esp)
c010103d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101040:	89 04 24             	mov    %eax,(%esp)
c0101043:	e8 f2 fe ff ff       	call   c0100f3a <runcmd>
c0101048:	85 c0                	test   %eax,%eax
c010104a:	79 d4                	jns    c0101020 <monitor+0x34>
				break;
			}
		}
	}
}
c010104c:	90                   	nop
c010104d:	c9                   	leave  
c010104e:	c3                   	ret    

c010104f <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c010104f:	55                   	push   %ebp
c0101050:	89 e5                	mov    %esp,%ebp
c0101052:	83 ec 28             	sub    $0x28,%esp
	int i;
	for (i = 0; i < NCOMMANDS; i ++) {
c0101055:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c010105c:	eb 3f                	jmp    c010109d <mon_help+0x4e>
		cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c010105e:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101061:	89 d0                	mov    %edx,%eax
c0101063:	01 c0                	add    %eax,%eax
c0101065:	01 d0                	add    %edx,%eax
c0101067:	c1 e0 02             	shl    $0x2,%eax
c010106a:	05 40 a0 11 c0       	add    $0xc011a040,%eax
c010106f:	8b 48 04             	mov    0x4(%eax),%ecx
c0101072:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101075:	89 d0                	mov    %edx,%eax
c0101077:	01 c0                	add    %eax,%eax
c0101079:	01 d0                	add    %edx,%eax
c010107b:	c1 e0 02             	shl    $0x2,%eax
c010107e:	05 40 a0 11 c0       	add    $0xc011a040,%eax
c0101083:	8b 00                	mov    (%eax),%eax
c0101085:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0101089:	89 44 24 04          	mov    %eax,0x4(%esp)
c010108d:	c7 04 24 49 74 10 c0 	movl   $0xc0107449,(%esp)
c0101094:	e8 17 f1 ff ff       	call   c01001b0 <cprintf>

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
	int i;
	for (i = 0; i < NCOMMANDS; i ++) {
c0101099:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010109d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01010a0:	83 f8 08             	cmp    $0x8,%eax
c01010a3:	76 b9                	jbe    c010105e <mon_help+0xf>
		cprintf("%s - %s\n", commands[i].name, commands[i].desc);
	}
	return 0;
c01010a5:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01010aa:	c9                   	leave  
c01010ab:	c3                   	ret    

c01010ac <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c01010ac:	55                   	push   %ebp
c01010ad:	89 e5                	mov    %esp,%ebp
c01010af:	83 ec 08             	sub    $0x8,%esp
	print_kerninfo();
c01010b2:	e8 4b f6 ff ff       	call   c0100702 <print_kerninfo>
	return 0;
c01010b7:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01010bc:	c9                   	leave  
c01010bd:	c3                   	ret    

c01010be <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c01010be:	55                   	push   %ebp
c01010bf:	89 e5                	mov    %esp,%ebp
c01010c1:	83 ec 08             	sub    $0x8,%esp
	print_stackframe();
c01010c4:	e8 87 f7 ff ff       	call   c0100850 <print_stackframe>
	return 0;
c01010c9:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01010ce:	c9                   	leave  
c01010cf:	c3                   	ret    

c01010d0 <mon_continue>:

/* mon_continue - continue execution if it isn't kernel panic */
int
mon_continue(int argc, char **argv, struct trapframe *tf) {
c01010d0:	55                   	push   %ebp
c01010d1:	89 e5                	mov    %esp,%ebp
c01010d3:	83 ec 18             	sub    $0x18,%esp
	if (is_kernel_panic()) {
c01010d6:	e8 e2 05 00 00       	call   c01016bd <is_kernel_panic>
c01010db:	85 c0                	test   %eax,%eax
c01010dd:	74 13                	je     c01010f2 <mon_continue+0x22>
		cprintf("can't continue execution in kernel panic.\n");
c01010df:	c7 04 24 54 74 10 c0 	movl   $0xc0107454,(%esp)
c01010e6:	e8 c5 f0 ff ff       	call   c01001b0 <cprintf>
		return 0;
c01010eb:	b8 00 00 00 00       	mov    $0x0,%eax
c01010f0:	eb 1c                	jmp    c010110e <mon_continue+0x3e>
	}
	if (tf != NULL) {
c01010f2:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01010f6:	74 11                	je     c0101109 <mon_continue+0x39>
		tf->tf_eflags &= ~FL_TF;
c01010f8:	8b 45 10             	mov    0x10(%ebp),%eax
c01010fb:	8b 40 38             	mov    0x38(%eax),%eax
c01010fe:	89 c2                	mov    %eax,%edx
c0101100:	80 e6 fe             	and    $0xfe,%dh
c0101103:	8b 45 10             	mov    0x10(%ebp),%eax
c0101106:	89 50 38             	mov    %edx,0x38(%eax)
	}
	return -1;
c0101109:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c010110e:	c9                   	leave  
c010110f:	c3                   	ret    

c0101110 <mon_step>:

/* mon_step - run a single step */
int
mon_step(int argc, char **argv, struct trapframe *tf) {
c0101110:	55                   	push   %ebp
c0101111:	89 e5                	mov    %esp,%ebp
c0101113:	83 ec 18             	sub    $0x18,%esp
	if (is_kernel_panic()) {
c0101116:	e8 a2 05 00 00       	call   c01016bd <is_kernel_panic>
c010111b:	85 c0                	test   %eax,%eax
c010111d:	74 13                	je     c0101132 <mon_step+0x22>
		cprintf("can't continue execution in kernel panic.\n");
c010111f:	c7 04 24 54 74 10 c0 	movl   $0xc0107454,(%esp)
c0101126:	e8 85 f0 ff ff       	call   c01001b0 <cprintf>
		return 0;
c010112b:	b8 00 00 00 00       	mov    $0x0,%eax
c0101130:	eb 2f                	jmp    c0101161 <mon_step+0x51>
	}
	if (tf != NULL) {
c0101132:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0101136:	74 18                	je     c0101150 <mon_step+0x40>
		tf->tf_eflags |= FL_TF;
c0101138:	8b 45 10             	mov    0x10(%ebp),%eax
c010113b:	8b 40 38             	mov    0x38(%eax),%eax
c010113e:	89 c2                	mov    %eax,%edx
c0101140:	80 ce 01             	or     $0x1,%dh
c0101143:	8b 45 10             	mov    0x10(%ebp),%eax
c0101146:	89 50 38             	mov    %edx,0x38(%eax)
		return -1;
c0101149:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c010114e:	eb 11                	jmp    c0101161 <mon_step+0x51>
	}
	cprintf("trapframe is NULL, can't run step.\n");
c0101150:	c7 04 24 80 74 10 c0 	movl   $0xc0107480,(%esp)
c0101157:	e8 54 f0 ff ff       	call   c01001b0 <cprintf>
	return 0;
c010115c:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101161:	c9                   	leave  
c0101162:	c3                   	ret    

c0101163 <mon_breakpoint>:

/* mon_breakpoint - set a breakpoint */
int
mon_breakpoint(int argc, char **argv, struct trapframe *tf) {
c0101163:	55                   	push   %ebp
c0101164:	89 e5                	mov    %esp,%ebp
c0101166:	83 ec 38             	sub    $0x38,%esp
	if (argc != 2) {
c0101169:	83 7d 08 02          	cmpl   $0x2,0x8(%ebp)
c010116d:	74 16                	je     c0101185 <mon_breakpoint+0x22>
		cprintf("needs 2 parameter(s).\n");
c010116f:	c7 04 24 a4 74 10 c0 	movl   $0xc01074a4,(%esp)
c0101176:	e8 35 f0 ff ff       	call   c01001b0 <cprintf>
		return 0;
c010117b:	b8 00 00 00 00       	mov    $0x0,%eax
c0101180:	e9 68 01 00 00       	jmp    c01012ed <mon_breakpoint+0x18a>
	}
	uintptr_t addr;
	unsigned regnum = MAX_DR_NUM, type = 0, len = 3;
c0101185:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
c010118c:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0101193:	c7 45 e4 03 00 00 00 	movl   $0x3,-0x1c(%ebp)
	int i;
	for (i = 0; i < argc; i ++) {
c010119a:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c01011a1:	e9 b6 00 00 00       	jmp    c010125c <mon_breakpoint+0xf9>
		if (argv[i][0] == '-') {
c01011a6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01011a9:	c1 e0 02             	shl    $0x2,%eax
c01011ac:	03 45 0c             	add    0xc(%ebp),%eax
c01011af:	8b 00                	mov    (%eax),%eax
c01011b1:	0f b6 00             	movzbl (%eax),%eax
c01011b4:	3c 2d                	cmp    $0x2d,%al
c01011b6:	75 71                	jne    c0101229 <mon_breakpoint+0xc6>
			if (argv[i][1] != 'r' || strlen(argv[i]) != 3) {
c01011b8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01011bb:	c1 e0 02             	shl    $0x2,%eax
c01011be:	03 45 0c             	add    0xc(%ebp),%eax
c01011c1:	8b 00                	mov    (%eax),%eax
c01011c3:	83 c0 01             	add    $0x1,%eax
c01011c6:	0f b6 00             	movzbl (%eax),%eax
c01011c9:	3c 72                	cmp    $0x72,%al
c01011cb:	0f 85 f5 00 00 00    	jne    c01012c6 <mon_breakpoint+0x163>
c01011d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01011d4:	c1 e0 02             	shl    $0x2,%eax
c01011d7:	03 45 0c             	add    0xc(%ebp),%eax
c01011da:	8b 00                	mov    (%eax),%eax
c01011dc:	89 04 24             	mov    %eax,(%esp)
c01011df:	e8 e4 56 00 00       	call   c01068c8 <strlen>
c01011e4:	83 f8 03             	cmp    $0x3,%eax
c01011e7:	0f 85 d9 00 00 00    	jne    c01012c6 <mon_breakpoint+0x163>
				goto bad_argv;
			}
			else {
				switch (argv[i][2]) {
c01011ed:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01011f0:	c1 e0 02             	shl    $0x2,%eax
c01011f3:	03 45 0c             	add    0xc(%ebp),%eax
c01011f6:	8b 00                	mov    (%eax),%eax
c01011f8:	83 c0 02             	add    $0x2,%eax
c01011fb:	0f b6 00             	movzbl (%eax),%eax
c01011fe:	0f be c0             	movsbl %al,%eax
c0101201:	83 e8 30             	sub    $0x30,%eax
c0101204:	83 f8 03             	cmp    $0x3,%eax
c0101207:	0f 87 b5 00 00 00    	ja     c01012c2 <mon_breakpoint+0x15f>
				case '0' ... '3': regnum = argv[i][2] - '0'; break;
c010120d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101210:	c1 e0 02             	shl    $0x2,%eax
c0101213:	03 45 0c             	add    0xc(%ebp),%eax
c0101216:	8b 00                	mov    (%eax),%eax
c0101218:	83 c0 02             	add    $0x2,%eax
c010121b:	0f b6 00             	movzbl (%eax),%eax
c010121e:	0f be c0             	movsbl %al,%eax
c0101221:	83 e8 30             	sub    $0x30,%eax
c0101224:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0101227:	eb 2f                	jmp    c0101258 <mon_breakpoint+0xf5>
				}
			}
		}
		else {
			char *endptr;
			addr = strtol(argv[i], &endptr, 16);
c0101229:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010122c:	c1 e0 02             	shl    $0x2,%eax
c010122f:	03 45 0c             	add    0xc(%ebp),%eax
c0101232:	8b 00                	mov    (%eax),%eax
c0101234:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c010123b:	00 
c010123c:	8d 55 dc             	lea    -0x24(%ebp),%edx
c010123f:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101243:	89 04 24             	mov    %eax,(%esp)
c0101246:	e8 5f 58 00 00       	call   c0106aaa <strtol>
c010124b:	89 45 f4             	mov    %eax,-0xc(%ebp)
			if (*endptr != '\0') {
c010124e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0101251:	0f b6 00             	movzbl (%eax),%eax
c0101254:	84 c0                	test   %al,%al
c0101256:	75 6d                	jne    c01012c5 <mon_breakpoint+0x162>
		return 0;
	}
	uintptr_t addr;
	unsigned regnum = MAX_DR_NUM, type = 0, len = 3;
	int i;
	for (i = 0; i < argc; i ++) {
c0101258:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c010125c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010125f:	3b 45 08             	cmp    0x8(%ebp),%eax
c0101262:	0f 8c 3e ff ff ff    	jl     c01011a6 <mon_breakpoint+0x43>
			if (*endptr != '\0') {
				goto bad_argv;
			}
		}
	}
	int ret = debug_enable_dr(regnum, addr, type, len);
c0101268:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010126b:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010126f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0101272:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101276:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101279:	89 44 24 04          	mov    %eax,0x4(%esp)
c010127d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101280:	89 04 24             	mov    %eax,(%esp)
c0101283:	e8 aa f8 ff ff       	call   c0100b32 <debug_enable_dr>
c0101288:	89 45 e0             	mov    %eax,-0x20(%ebp)
	cprintf("set breakpoint [%d] at 0x%08x: %s.\n", regnum, addr,
c010128b:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010128f:	75 07                	jne    c0101298 <mon_breakpoint+0x135>
c0101291:	b8 bb 74 10 c0       	mov    $0xc01074bb,%eax
c0101296:	eb 05                	jmp    c010129d <mon_breakpoint+0x13a>
c0101298:	b8 c5 74 10 c0       	mov    $0xc01074c5,%eax
c010129d:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01012a1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01012a4:	89 44 24 08          	mov    %eax,0x8(%esp)
c01012a8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01012ab:	89 44 24 04          	mov    %eax,0x4(%esp)
c01012af:	c7 04 24 cc 74 10 c0 	movl   $0xc01074cc,(%esp)
c01012b6:	e8 f5 ee ff ff       	call   c01001b0 <cprintf>
			(ret == 0) ? "successed" : "failed");
	return 0;
c01012bb:	b8 00 00 00 00       	mov    $0x0,%eax
c01012c0:	eb 2b                	jmp    c01012ed <mon_breakpoint+0x18a>
				goto bad_argv;
			}
			else {
				switch (argv[i][2]) {
				case '0' ... '3': regnum = argv[i][2] - '0'; break;
				default: goto bad_argv;
c01012c2:	90                   	nop
c01012c3:	eb 01                	jmp    c01012c6 <mon_breakpoint+0x163>
		}
		else {
			char *endptr;
			addr = strtol(argv[i], &endptr, 16);
			if (*endptr != '\0') {
				goto bad_argv;
c01012c5:	90                   	nop
	cprintf("set breakpoint [%d] at 0x%08x: %s.\n", regnum, addr,
			(ret == 0) ? "successed" : "failed");
	return 0;

bad_argv:
	cprintf("unknow parameter(s): [%d] %s\n", i, argv[i]);
c01012c6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01012c9:	c1 e0 02             	shl    $0x2,%eax
c01012cc:	03 45 0c             	add    0xc(%ebp),%eax
c01012cf:	8b 00                	mov    (%eax),%eax
c01012d1:	89 44 24 08          	mov    %eax,0x8(%esp)
c01012d5:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01012d8:	89 44 24 04          	mov    %eax,0x4(%esp)
c01012dc:	c7 04 24 f0 74 10 c0 	movl   $0xc01074f0,(%esp)
c01012e3:	e8 c8 ee ff ff       	call   c01001b0 <cprintf>
	return 0;
c01012e8:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01012ed:	c9                   	leave  
c01012ee:	c3                   	ret    

c01012ef <mon_watchpoint>:

/* mon_watchpoint - set a watchpoint */
int
mon_watchpoint(int argc, char **argv, struct trapframe *tf) {
c01012ef:	55                   	push   %ebp
c01012f0:	89 e5                	mov    %esp,%ebp
c01012f2:	83 ec 38             	sub    $0x38,%esp
	if (argc < 2) {
c01012f5:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c01012f9:	7f 16                	jg     c0101311 <mon_watchpoint+0x22>
		cprintf("needs at least 2 parameter(s).\n");
c01012fb:	c7 04 24 10 75 10 c0 	movl   $0xc0107510,(%esp)
c0101302:	e8 a9 ee ff ff       	call   c01001b0 <cprintf>
		return 0;
c0101307:	b8 00 00 00 00       	mov    $0x0,%eax
c010130c:	e9 17 02 00 00       	jmp    c0101528 <mon_watchpoint+0x239>
	}
	uintptr_t addr;
	unsigned regnum = MAX_DR_NUM, type = 1, len = 3;
c0101311:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
c0101318:	c7 45 ec 01 00 00 00 	movl   $0x1,-0x14(%ebp)
c010131f:	c7 45 e8 03 00 00 00 	movl   $0x3,-0x18(%ebp)
	int i;
	for (i = 0; i < argc; i ++) {
c0101326:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c010132d:	e9 5f 01 00 00       	jmp    c0101491 <mon_watchpoint+0x1a2>
		if (argv[i][0] == '-') {
c0101332:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101335:	c1 e0 02             	shl    $0x2,%eax
c0101338:	03 45 0c             	add    0xc(%ebp),%eax
c010133b:	8b 00                	mov    (%eax),%eax
c010133d:	0f b6 00             	movzbl (%eax),%eax
c0101340:	3c 2d                	cmp    $0x2d,%al
c0101342:	0f 85 16 01 00 00    	jne    c010145e <mon_watchpoint+0x16f>
			char c = argv[i][1];
c0101348:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010134b:	c1 e0 02             	shl    $0x2,%eax
c010134e:	03 45 0c             	add    0xc(%ebp),%eax
c0101351:	8b 00                	mov    (%eax),%eax
c0101353:	83 c0 01             	add    $0x1,%eax
c0101356:	0f b6 00             	movzbl (%eax),%eax
c0101359:	88 45 e3             	mov    %al,-0x1d(%ebp)
			if ((c != 'r' && c != 't' && c != 'l') || strlen(argv[i]) != 3) {
c010135c:	80 7d e3 72          	cmpb   $0x72,-0x1d(%ebp)
c0101360:	74 10                	je     c0101372 <mon_watchpoint+0x83>
c0101362:	80 7d e3 74          	cmpb   $0x74,-0x1d(%ebp)
c0101366:	74 0a                	je     c0101372 <mon_watchpoint+0x83>
c0101368:	80 7d e3 6c          	cmpb   $0x6c,-0x1d(%ebp)
c010136c:	0f 85 8f 01 00 00    	jne    c0101501 <mon_watchpoint+0x212>
c0101372:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101375:	c1 e0 02             	shl    $0x2,%eax
c0101378:	03 45 0c             	add    0xc(%ebp),%eax
c010137b:	8b 00                	mov    (%eax),%eax
c010137d:	89 04 24             	mov    %eax,(%esp)
c0101380:	e8 43 55 00 00       	call   c01068c8 <strlen>
c0101385:	83 f8 03             	cmp    $0x3,%eax
c0101388:	0f 85 73 01 00 00    	jne    c0101501 <mon_watchpoint+0x212>
				goto bad_argv;
			}
			switch (c) {
c010138e:	0f be 45 e3          	movsbl -0x1d(%ebp),%eax
c0101392:	83 f8 72             	cmp    $0x72,%eax
c0101395:	74 0f                	je     c01013a6 <mon_watchpoint+0xb7>
c0101397:	83 f8 74             	cmp    $0x74,%eax
c010139a:	74 49                	je     c01013e5 <mon_watchpoint+0xf6>
c010139c:	83 f8 6c             	cmp    $0x6c,%eax
c010139f:	74 7a                	je     c010141b <mon_watchpoint+0x12c>
				case '1': len = 0; break;
				case '2': len = 1; break;
				case '4': len = 3; break;
				default: goto bad_argv;
				}
				break;
c01013a1:	e9 e7 00 00 00       	jmp    c010148d <mon_watchpoint+0x19e>
			if ((c != 'r' && c != 't' && c != 'l') || strlen(argv[i]) != 3) {
				goto bad_argv;
			}
			switch (c) {
			case 'r':
				switch (argv[i][2]) {
c01013a6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01013a9:	c1 e0 02             	shl    $0x2,%eax
c01013ac:	03 45 0c             	add    0xc(%ebp),%eax
c01013af:	8b 00                	mov    (%eax),%eax
c01013b1:	83 c0 02             	add    $0x2,%eax
c01013b4:	0f b6 00             	movzbl (%eax),%eax
c01013b7:	0f be c0             	movsbl %al,%eax
c01013ba:	83 e8 30             	sub    $0x30,%eax
c01013bd:	83 f8 03             	cmp    $0x3,%eax
c01013c0:	0f 87 31 01 00 00    	ja     c01014f7 <mon_watchpoint+0x208>
				case '0' ... '3': regnum = argv[i][2] - '0'; break;
c01013c6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01013c9:	c1 e0 02             	shl    $0x2,%eax
c01013cc:	03 45 0c             	add    0xc(%ebp),%eax
c01013cf:	8b 00                	mov    (%eax),%eax
c01013d1:	83 c0 02             	add    $0x2,%eax
c01013d4:	0f b6 00             	movzbl (%eax),%eax
c01013d7:	0f be c0             	movsbl %al,%eax
c01013da:	83 e8 30             	sub    $0x30,%eax
c01013dd:	89 45 f0             	mov    %eax,-0x10(%ebp)
				default: goto bad_argv;
				}
				break;
c01013e0:	e9 a8 00 00 00       	jmp    c010148d <mon_watchpoint+0x19e>
			case 't':
				switch (argv[i][2]) {
c01013e5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01013e8:	c1 e0 02             	shl    $0x2,%eax
c01013eb:	03 45 0c             	add    0xc(%ebp),%eax
c01013ee:	8b 00                	mov    (%eax),%eax
c01013f0:	83 c0 02             	add    $0x2,%eax
c01013f3:	0f b6 00             	movzbl (%eax),%eax
c01013f6:	0f be c0             	movsbl %al,%eax
c01013f9:	83 f8 61             	cmp    $0x61,%eax
c01013fc:	74 12                	je     c0101410 <mon_watchpoint+0x121>
c01013fe:	83 f8 77             	cmp    $0x77,%eax
c0101401:	0f 85 f3 00 00 00    	jne    c01014fa <mon_watchpoint+0x20b>
				case 'w': type = 1; break;
c0101407:	c7 45 ec 01 00 00 00 	movl   $0x1,-0x14(%ebp)
c010140e:	eb 08                	jmp    c0101418 <mon_watchpoint+0x129>
				case 'a': type = 3; break;
c0101410:	c7 45 ec 03 00 00 00 	movl   $0x3,-0x14(%ebp)
c0101417:	90                   	nop
				default: goto bad_argv;
				}
				break;
c0101418:	90                   	nop
c0101419:	eb 72                	jmp    c010148d <mon_watchpoint+0x19e>
			case 'l':
				switch (argv[i][2]) {
c010141b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010141e:	c1 e0 02             	shl    $0x2,%eax
c0101421:	03 45 0c             	add    0xc(%ebp),%eax
c0101424:	8b 00                	mov    (%eax),%eax
c0101426:	83 c0 02             	add    $0x2,%eax
c0101429:	0f b6 00             	movzbl (%eax),%eax
c010142c:	0f be c0             	movsbl %al,%eax
c010142f:	83 f8 32             	cmp    $0x32,%eax
c0101432:	74 17                	je     c010144b <mon_watchpoint+0x15c>
c0101434:	83 f8 34             	cmp    $0x34,%eax
c0101437:	74 1b                	je     c0101454 <mon_watchpoint+0x165>
c0101439:	83 f8 31             	cmp    $0x31,%eax
c010143c:	0f 85 bb 00 00 00    	jne    c01014fd <mon_watchpoint+0x20e>
				case '1': len = 0; break;
c0101442:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0101449:	eb 11                	jmp    c010145c <mon_watchpoint+0x16d>
				case '2': len = 1; break;
c010144b:	c7 45 e8 01 00 00 00 	movl   $0x1,-0x18(%ebp)
c0101452:	eb 08                	jmp    c010145c <mon_watchpoint+0x16d>
				case '4': len = 3; break;
c0101454:	c7 45 e8 03 00 00 00 	movl   $0x3,-0x18(%ebp)
c010145b:	90                   	nop
				default: goto bad_argv;
				}
				break;
c010145c:	eb 2f                	jmp    c010148d <mon_watchpoint+0x19e>
			}
		}
		else {
			char *endptr;
			addr = strtol(argv[i], &endptr, 16);
c010145e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101461:	c1 e0 02             	shl    $0x2,%eax
c0101464:	03 45 0c             	add    0xc(%ebp),%eax
c0101467:	8b 00                	mov    (%eax),%eax
c0101469:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0101470:	00 
c0101471:	8d 55 d8             	lea    -0x28(%ebp),%edx
c0101474:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101478:	89 04 24             	mov    %eax,(%esp)
c010147b:	e8 2a 56 00 00       	call   c0106aaa <strtol>
c0101480:	89 45 f4             	mov    %eax,-0xc(%ebp)
			if (*endptr != '\0') {
c0101483:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0101486:	0f b6 00             	movzbl (%eax),%eax
c0101489:	84 c0                	test   %al,%al
c010148b:	75 73                	jne    c0101500 <mon_watchpoint+0x211>
		return 0;
	}
	uintptr_t addr;
	unsigned regnum = MAX_DR_NUM, type = 1, len = 3;
	int i;
	for (i = 0; i < argc; i ++) {
c010148d:	83 45 e4 01          	addl   $0x1,-0x1c(%ebp)
c0101491:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101494:	3b 45 08             	cmp    0x8(%ebp),%eax
c0101497:	0f 8c 95 fe ff ff    	jl     c0101332 <mon_watchpoint+0x43>
			if (*endptr != '\0') {
				goto bad_argv;
			}
		}
	}
	int ret = debug_enable_dr(regnum, addr, type, len);
c010149d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01014a0:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01014a4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01014a7:	89 44 24 08          	mov    %eax,0x8(%esp)
c01014ab:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01014ae:	89 44 24 04          	mov    %eax,0x4(%esp)
c01014b2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01014b5:	89 04 24             	mov    %eax,(%esp)
c01014b8:	e8 75 f6 ff ff       	call   c0100b32 <debug_enable_dr>
c01014bd:	89 45 dc             	mov    %eax,-0x24(%ebp)
	cprintf("set watchpoint [%d] at 0x%08x: %s.\n", regnum, addr,
c01014c0:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c01014c4:	75 07                	jne    c01014cd <mon_watchpoint+0x1de>
c01014c6:	b8 bb 74 10 c0       	mov    $0xc01074bb,%eax
c01014cb:	eb 05                	jmp    c01014d2 <mon_watchpoint+0x1e3>
c01014cd:	b8 c5 74 10 c0       	mov    $0xc01074c5,%eax
c01014d2:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01014d6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01014d9:	89 44 24 08          	mov    %eax,0x8(%esp)
c01014dd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01014e0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01014e4:	c7 04 24 30 75 10 c0 	movl   $0xc0107530,(%esp)
c01014eb:	e8 c0 ec ff ff       	call   c01001b0 <cprintf>
			(ret == 0) ? "successed" : "failed");
	return 0;
c01014f0:	b8 00 00 00 00       	mov    $0x0,%eax
c01014f5:	eb 31                	jmp    c0101528 <mon_watchpoint+0x239>
			}
			switch (c) {
			case 'r':
				switch (argv[i][2]) {
				case '0' ... '3': regnum = argv[i][2] - '0'; break;
				default: goto bad_argv;
c01014f7:	90                   	nop
c01014f8:	eb 07                	jmp    c0101501 <mon_watchpoint+0x212>
				break;
			case 't':
				switch (argv[i][2]) {
				case 'w': type = 1; break;
				case 'a': type = 3; break;
				default: goto bad_argv;
c01014fa:	90                   	nop
c01014fb:	eb 04                	jmp    c0101501 <mon_watchpoint+0x212>
			case 'l':
				switch (argv[i][2]) {
				case '1': len = 0; break;
				case '2': len = 1; break;
				case '4': len = 3; break;
				default: goto bad_argv;
c01014fd:	90                   	nop
c01014fe:	eb 01                	jmp    c0101501 <mon_watchpoint+0x212>
		}
		else {
			char *endptr;
			addr = strtol(argv[i], &endptr, 16);
			if (*endptr != '\0') {
				goto bad_argv;
c0101500:	90                   	nop
	cprintf("set watchpoint [%d] at 0x%08x: %s.\n", regnum, addr,
			(ret == 0) ? "successed" : "failed");
	return 0;

bad_argv:
	cprintf("unknow parameter(s): [%d] %s\n", i, argv[i]);
c0101501:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101504:	c1 e0 02             	shl    $0x2,%eax
c0101507:	03 45 0c             	add    0xc(%ebp),%eax
c010150a:	8b 00                	mov    (%eax),%eax
c010150c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101510:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101513:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101517:	c7 04 24 f0 74 10 c0 	movl   $0xc01074f0,(%esp)
c010151e:	e8 8d ec ff ff       	call   c01001b0 <cprintf>
	return 0;
c0101523:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101528:	c9                   	leave  
c0101529:	c3                   	ret    

c010152a <mon_delete_dr>:

/* mon_delete_dr - delete a breakpoint or watchpoint */
int
mon_delete_dr(int argc, char **argv, struct trapframe *tf) {
c010152a:	55                   	push   %ebp
c010152b:	89 e5                	mov    %esp,%ebp
c010152d:	83 ec 28             	sub    $0x28,%esp
	if (argc != 1) {
c0101530:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c0101534:	74 16                	je     c010154c <mon_delete_dr+0x22>
		cprintf("needs 1 parameter(s).\n");
c0101536:	c7 04 24 54 75 10 c0 	movl   $0xc0107554,(%esp)
c010153d:	e8 6e ec ff ff       	call   c01001b0 <cprintf>
		return 0;
c0101542:	b8 00 00 00 00       	mov    $0x0,%eax
c0101547:	e9 a1 00 00 00       	jmp    c01015ed <mon_delete_dr+0xc3>
	}
	unsigned regnum = MAX_DR_NUM;
c010154c:	c7 45 f4 04 00 00 00 	movl   $0x4,-0xc(%ebp)
	if (strlen(argv[0]) != 1) {
c0101553:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101556:	8b 00                	mov    (%eax),%eax
c0101558:	89 04 24             	mov    %eax,(%esp)
c010155b:	e8 68 53 00 00       	call   c01068c8 <strlen>
c0101560:	83 f8 01             	cmp    $0x1,%eax
c0101563:	75 62                	jne    c01015c7 <mon_delete_dr+0x9d>
		goto bad_argv;
	}
	else {
		switch (argv[0][0]) {
c0101565:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101568:	8b 00                	mov    (%eax),%eax
c010156a:	0f b6 00             	movzbl (%eax),%eax
c010156d:	0f be c0             	movsbl %al,%eax
c0101570:	83 e8 30             	sub    $0x30,%eax
c0101573:	83 f8 03             	cmp    $0x3,%eax
c0101576:	77 52                	ja     c01015ca <mon_delete_dr+0xa0>
		case '0' ... '3': regnum = argv[0][0] - '0'; break;
c0101578:	8b 45 0c             	mov    0xc(%ebp),%eax
c010157b:	8b 00                	mov    (%eax),%eax
c010157d:	0f b6 00             	movzbl (%eax),%eax
c0101580:	0f be c0             	movsbl %al,%eax
c0101583:	83 e8 30             	sub    $0x30,%eax
c0101586:	89 45 f4             	mov    %eax,-0xc(%ebp)
		default: goto bad_argv;
		}
	}
	int ret = debug_disable_dr(regnum);
c0101589:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010158c:	89 04 24             	mov    %eax,(%esp)
c010158f:	e8 67 f6 ff ff       	call   c0100bfb <debug_disable_dr>
c0101594:	89 45 f0             	mov    %eax,-0x10(%ebp)
	cprintf("delete [%d]: %s.\n", regnum,
c0101597:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010159b:	75 07                	jne    c01015a4 <mon_delete_dr+0x7a>
c010159d:	b8 bb 74 10 c0       	mov    $0xc01074bb,%eax
c01015a2:	eb 05                	jmp    c01015a9 <mon_delete_dr+0x7f>
c01015a4:	b8 c5 74 10 c0       	mov    $0xc01074c5,%eax
c01015a9:	89 44 24 08          	mov    %eax,0x8(%esp)
c01015ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01015b0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01015b4:	c7 04 24 6b 75 10 c0 	movl   $0xc010756b,(%esp)
c01015bb:	e8 f0 eb ff ff       	call   c01001b0 <cprintf>
			(ret == 0) ? "successed" : "failed");
	return 0;
c01015c0:	b8 00 00 00 00       	mov    $0x0,%eax
c01015c5:	eb 26                	jmp    c01015ed <mon_delete_dr+0xc3>
		cprintf("needs 1 parameter(s).\n");
		return 0;
	}
	unsigned regnum = MAX_DR_NUM;
	if (strlen(argv[0]) != 1) {
		goto bad_argv;
c01015c7:	90                   	nop
c01015c8:	eb 01                	jmp    c01015cb <mon_delete_dr+0xa1>
	}
	else {
		switch (argv[0][0]) {
		case '0' ... '3': regnum = argv[0][0] - '0'; break;
		default: goto bad_argv;
c01015ca:	90                   	nop
	cprintf("delete [%d]: %s.\n", regnum,
			(ret == 0) ? "successed" : "failed");
	return 0;

bad_argv:
	cprintf("unknow parameter(s): [%d] %s\n", 0, argv[0]);
c01015cb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01015ce:	8b 00                	mov    (%eax),%eax
c01015d0:	89 44 24 08          	mov    %eax,0x8(%esp)
c01015d4:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01015db:	00 
c01015dc:	c7 04 24 f0 74 10 c0 	movl   $0xc01074f0,(%esp)
c01015e3:	e8 c8 eb ff ff       	call   c01001b0 <cprintf>
	return 0;
c01015e8:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01015ed:	c9                   	leave  
c01015ee:	c3                   	ret    

c01015ef <mon_list_dr>:

/* mon_list_dr - list all debug registers */
int
mon_list_dr(int argc, char **argv, struct trapframe *tf) {
c01015ef:	55                   	push   %ebp
c01015f0:	89 e5                	mov    %esp,%ebp
c01015f2:	83 ec 08             	sub    $0x8,%esp
	debug_list_dr();
c01015f5:	e8 c3 f6 ff ff       	call   c0100cbd <debug_list_dr>
	return 0;
c01015fa:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01015ff:	c9                   	leave  
c0101600:	c3                   	ret    
c0101601:	00 00                	add    %al,(%eax)
	...

c0101604 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0101604:	55                   	push   %ebp
c0101605:	89 e5                	mov    %esp,%ebp
c0101607:	83 ec 28             	sub    $0x28,%esp
	if (is_panic) {
c010160a:	a1 cc ae 11 c0       	mov    0xc011aecc,%eax
c010160f:	85 c0                	test   %eax,%eax
c0101611:	75 4d                	jne    c0101660 <__panic+0x5c>
		goto panic_dead;
	}
	is_panic = 1;
c0101613:	c7 05 cc ae 11 c0 01 	movl   $0x1,0xc011aecc
c010161a:	00 00 00 

	// print the 'message'
	va_list ap;
	va_start(ap, fmt);
c010161d:	8d 45 10             	lea    0x10(%ebp),%eax
c0101620:	83 c0 04             	add    $0x4,%eax
c0101623:	89 45 f4             	mov    %eax,-0xc(%ebp)
	cprintf("kernel panic at %s:%d:\n    ", file, line);
c0101626:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101629:	89 44 24 08          	mov    %eax,0x8(%esp)
c010162d:	8b 45 08             	mov    0x8(%ebp),%eax
c0101630:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101634:	c7 04 24 7d 75 10 c0 	movl   $0xc010757d,(%esp)
c010163b:	e8 70 eb ff ff       	call   c01001b0 <cprintf>
	vcprintf(fmt, ap);
c0101640:	8b 45 10             	mov    0x10(%ebp),%eax
c0101643:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101646:	89 54 24 04          	mov    %edx,0x4(%esp)
c010164a:	89 04 24             	mov    %eax,(%esp)
c010164d:	e8 2a eb ff ff       	call   c010017c <vcprintf>
	cprintf("\n");
c0101652:	c7 04 24 99 75 10 c0 	movl   $0xc0107599,(%esp)
c0101659:	e8 52 eb ff ff       	call   c01001b0 <cprintf>
c010165e:	eb 01                	jmp    c0101661 <__panic+0x5d>
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
	if (is_panic) {
		goto panic_dead;
c0101660:	90                   	nop
	vcprintf(fmt, ap);
	cprintf("\n");
	va_end(ap);

panic_dead:
	intr_disable();
c0101661:	e8 34 0a 00 00       	call   c010209a <intr_disable>
	while (1) {
		monitor(NULL);
c0101666:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010166d:	e8 7a f9 ff ff       	call   c0100fec <monitor>
	}
c0101672:	eb f2                	jmp    c0101666 <__panic+0x62>

c0101674 <__warn>:
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c0101674:	55                   	push   %ebp
c0101675:	89 e5                	mov    %esp,%ebp
c0101677:	83 ec 28             	sub    $0x28,%esp
	va_list ap;
	va_start(ap, fmt);
c010167a:	8d 45 10             	lea    0x10(%ebp),%eax
c010167d:	83 c0 04             	add    $0x4,%eax
c0101680:	89 45 f4             	mov    %eax,-0xc(%ebp)
	cprintf("kernel warning at %s:%d:\n    ", file, line);
c0101683:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101686:	89 44 24 08          	mov    %eax,0x8(%esp)
c010168a:	8b 45 08             	mov    0x8(%ebp),%eax
c010168d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101691:	c7 04 24 9b 75 10 c0 	movl   $0xc010759b,(%esp)
c0101698:	e8 13 eb ff ff       	call   c01001b0 <cprintf>
	vcprintf(fmt, ap);
c010169d:	8b 45 10             	mov    0x10(%ebp),%eax
c01016a0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01016a3:	89 54 24 04          	mov    %edx,0x4(%esp)
c01016a7:	89 04 24             	mov    %eax,(%esp)
c01016aa:	e8 cd ea ff ff       	call   c010017c <vcprintf>
	cprintf("\n");
c01016af:	c7 04 24 99 75 10 c0 	movl   $0xc0107599,(%esp)
c01016b6:	e8 f5 ea ff ff       	call   c01001b0 <cprintf>
	va_end(ap);
}
c01016bb:	c9                   	leave  
c01016bc:	c3                   	ret    

c01016bd <is_kernel_panic>:

bool
is_kernel_panic(void) {
c01016bd:	55                   	push   %ebp
c01016be:	89 e5                	mov    %esp,%ebp
	return is_panic;
c01016c0:	a1 cc ae 11 c0       	mov    0xc011aecc,%eax
}
c01016c5:	5d                   	pop    %ebp
c01016c6:	c3                   	ret    
	...

c01016c8 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c01016c8:	55                   	push   %ebp
c01016c9:	89 e5                	mov    %esp,%ebp
c01016cb:	83 ec 28             	sub    $0x28,%esp
c01016ce:	66 c7 45 f6 43 00    	movw   $0x43,-0xa(%ebp)
c01016d4:	c6 45 f5 34          	movb   $0x34,-0xb(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c01016d8:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01016dc:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c01016e0:	ee                   	out    %al,(%dx)
c01016e1:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c01016e7:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
c01016eb:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01016ef:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01016f3:	ee                   	out    %al,(%dx)
c01016f4:	66 c7 45 ee 40 00    	movw   $0x40,-0x12(%ebp)
c01016fa:	c6 45 ed 2e          	movb   $0x2e,-0x13(%ebp)
c01016fe:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101702:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101706:	ee                   	out    %al,(%dx)
	outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
	outb(IO_TIMER1, TIMER_DIV(100) % 256);
	outb(IO_TIMER1, TIMER_DIV(100) / 256);

	// initialize time counter 'ticks' to zero
	ticks = 0;
c0101707:	c7 05 8c ba 11 c0 00 	movl   $0x0,0xc011ba8c
c010170e:	00 00 00 

	cprintf("++ setup timer interrupts\n");
c0101711:	c7 04 24 b9 75 10 c0 	movl   $0xc01075b9,(%esp)
c0101718:	e8 93 ea ff ff       	call   c01001b0 <cprintf>
	pic_enable(IRQ_TIMER);
c010171d:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0101724:	e8 cf 09 00 00       	call   c01020f8 <pic_enable>
}
c0101729:	c9                   	leave  
c010172a:	c3                   	ret    
	...

c010172c <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c010172c:	55                   	push   %ebp
c010172d:	89 e5                	mov    %esp,%ebp
c010172f:	53                   	push   %ebx
c0101730:	83 ec 14             	sub    $0x14,%esp
}

static inline uint32_t
read_eflags(void) {
	uint32_t eflags;
	asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0101733:	9c                   	pushf  
c0101734:	5b                   	pop    %ebx
c0101735:	89 5d f4             	mov    %ebx,-0xc(%ebp)
	return eflags;
c0101738:	8b 45 f4             	mov    -0xc(%ebp),%eax
	if (read_eflags() & FL_IF) {
c010173b:	25 00 02 00 00       	and    $0x200,%eax
c0101740:	85 c0                	test   %eax,%eax
c0101742:	74 0c                	je     c0101750 <__intr_save+0x24>
		intr_disable();
c0101744:	e8 51 09 00 00       	call   c010209a <intr_disable>
		return 1;
c0101749:	b8 01 00 00 00       	mov    $0x1,%eax
c010174e:	eb 05                	jmp    c0101755 <__intr_save+0x29>
	}
	return 0;
c0101750:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101755:	83 c4 14             	add    $0x14,%esp
c0101758:	5b                   	pop    %ebx
c0101759:	5d                   	pop    %ebp
c010175a:	c3                   	ret    

c010175b <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c010175b:	55                   	push   %ebp
c010175c:	89 e5                	mov    %esp,%ebp
c010175e:	83 ec 08             	sub    $0x8,%esp
	if (flag) {
c0101761:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0101765:	74 05                	je     c010176c <__intr_restore+0x11>
		intr_enable();
c0101767:	e8 28 09 00 00       	call   c0102094 <intr_enable>
	}
}
c010176c:	c9                   	leave  
c010176d:	c3                   	ret    

c010176e <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c010176e:	55                   	push   %ebp
c010176f:	89 e5                	mov    %esp,%ebp
c0101771:	53                   	push   %ebx
c0101772:	83 ec 14             	sub    $0x14,%esp
c0101775:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c010177b:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c010177f:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101783:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101787:	ec                   	in     (%dx),%al
c0101788:	89 c3                	mov    %eax,%ebx
c010178a:	88 5d f9             	mov    %bl,-0x7(%ebp)
	return data;
c010178d:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101793:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101797:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c010179b:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010179f:	ec                   	in     (%dx),%al
c01017a0:	89 c3                	mov    %eax,%ebx
c01017a2:	88 5d f5             	mov    %bl,-0xb(%ebp)
	return data;
c01017a5:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01017ab:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01017af:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c01017b3:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01017b7:	ec                   	in     (%dx),%al
c01017b8:	89 c3                	mov    %eax,%ebx
c01017ba:	88 5d f1             	mov    %bl,-0xf(%ebp)
	return data;
c01017bd:	66 c7 45 ee 84 00    	movw   $0x84,-0x12(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01017c3:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c01017c7:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c01017cb:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01017cf:	ec                   	in     (%dx),%al
c01017d0:	89 c3                	mov    %eax,%ebx
c01017d2:	88 5d ed             	mov    %bl,-0x13(%ebp)
	inb(0x84);
	inb(0x84);
	inb(0x84);
	inb(0x84);
}
c01017d5:	83 c4 14             	add    $0x14,%esp
c01017d8:	5b                   	pop    %ebx
c01017d9:	5d                   	pop    %ebp
c01017da:	c3                   	ret    

c01017db <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c01017db:	55                   	push   %ebp
c01017dc:	89 e5                	mov    %esp,%ebp
c01017de:	53                   	push   %ebx
c01017df:	83 ec 24             	sub    $0x24,%esp
	volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c01017e2:	c7 45 f8 00 80 0b c0 	movl   $0xc00b8000,-0x8(%ebp)
	uint16_t was = *cp;
c01017e9:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01017ec:	0f b7 00             	movzwl (%eax),%eax
c01017ef:	66 89 45 f6          	mov    %ax,-0xa(%ebp)
	*cp = (uint16_t) 0xA55A;
c01017f3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01017f6:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
	if (*cp != 0xA55A) {
c01017fb:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01017fe:	0f b7 00             	movzwl (%eax),%eax
c0101801:	66 3d 5a a5          	cmp    $0xa55a,%ax
c0101805:	74 12                	je     c0101819 <cga_init+0x3e>
		cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0101807:	c7 45 f8 00 00 0b c0 	movl   $0xc00b0000,-0x8(%ebp)
		addr_6845 = MONO_BASE;
c010180e:	66 c7 05 e6 ae 11 c0 	movw   $0x3b4,0xc011aee6
c0101815:	b4 03 
c0101817:	eb 13                	jmp    c010182c <cga_init+0x51>
	} else {
		*cp = was;
c0101819:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010181c:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101820:	66 89 10             	mov    %dx,(%eax)
		addr_6845 = CGA_BASE;
c0101823:	66 c7 05 e6 ae 11 c0 	movw   $0x3d4,0xc011aee6
c010182a:	d4 03 
	}

	// Extract cursor location
	uint32_t pos;
	outb(addr_6845, 14);
c010182c:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c0101833:	0f b7 c0             	movzwl %ax,%eax
c0101836:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c010183a:	c6 45 ed 0e          	movb   $0xe,-0x13(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c010183e:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101842:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101846:	ee                   	out    %al,(%dx)
	pos = inb(addr_6845 + 1) << 8;
c0101847:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c010184e:	83 c0 01             	add    $0x1,%eax
c0101851:	0f b7 c0             	movzwl %ax,%eax
c0101854:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101858:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c010185c:	66 89 45 da          	mov    %ax,-0x26(%ebp)
c0101860:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101864:	ec                   	in     (%dx),%al
c0101865:	89 c3                	mov    %eax,%ebx
c0101867:	88 5d e9             	mov    %bl,-0x17(%ebp)
	return data;
c010186a:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c010186e:	0f b6 c0             	movzbl %al,%eax
c0101871:	c1 e0 08             	shl    $0x8,%eax
c0101874:	89 45 f0             	mov    %eax,-0x10(%ebp)
	outb(addr_6845, 15);
c0101877:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c010187e:	0f b7 c0             	movzwl %ax,%eax
c0101881:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0101885:	c6 45 e5 0f          	movb   $0xf,-0x1b(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101889:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c010188d:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101891:	ee                   	out    %al,(%dx)
	pos |= inb(addr_6845 + 1);
c0101892:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c0101899:	83 c0 01             	add    $0x1,%eax
c010189c:	0f b7 c0             	movzwl %ax,%eax
c010189f:	66 89 45 e2          	mov    %ax,-0x1e(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01018a3:	0f b7 45 e2          	movzwl -0x1e(%ebp),%eax
c01018a7:	66 89 45 da          	mov    %ax,-0x26(%ebp)
c01018ab:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c01018af:	ec                   	in     (%dx),%al
c01018b0:	89 c3                	mov    %eax,%ebx
c01018b2:	88 5d e1             	mov    %bl,-0x1f(%ebp)
	return data;
c01018b5:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01018b9:	0f b6 c0             	movzbl %al,%eax
c01018bc:	09 45 f0             	or     %eax,-0x10(%ebp)

	crt_buf = (uint16_t*) cp;
c01018bf:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01018c2:	a3 e0 ae 11 c0       	mov    %eax,0xc011aee0
	crt_pos = pos;
c01018c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01018ca:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
}
c01018d0:	83 c4 24             	add    $0x24,%esp
c01018d3:	5b                   	pop    %ebx
c01018d4:	5d                   	pop    %ebp
c01018d5:	c3                   	ret    

c01018d6 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c01018d6:	55                   	push   %ebp
c01018d7:	89 e5                	mov    %esp,%ebp
c01018d9:	53                   	push   %ebx
c01018da:	83 ec 54             	sub    $0x54,%esp
c01018dd:	66 c7 45 f6 fa 03    	movw   $0x3fa,-0xa(%ebp)
c01018e3:	c6 45 f5 00          	movb   $0x0,-0xb(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c01018e7:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01018eb:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c01018ef:	ee                   	out    %al,(%dx)
c01018f0:	66 c7 45 f2 fb 03    	movw   $0x3fb,-0xe(%ebp)
c01018f6:	c6 45 f1 80          	movb   $0x80,-0xf(%ebp)
c01018fa:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01018fe:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101902:	ee                   	out    %al,(%dx)
c0101903:	66 c7 45 ee f8 03    	movw   $0x3f8,-0x12(%ebp)
c0101909:	c6 45 ed 0c          	movb   $0xc,-0x13(%ebp)
c010190d:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101911:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101915:	ee                   	out    %al,(%dx)
c0101916:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c010191c:	c6 45 e9 00          	movb   $0x0,-0x17(%ebp)
c0101920:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101924:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101928:	ee                   	out    %al,(%dx)
c0101929:	66 c7 45 e6 fb 03    	movw   $0x3fb,-0x1a(%ebp)
c010192f:	c6 45 e5 03          	movb   $0x3,-0x1b(%ebp)
c0101933:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101937:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c010193b:	ee                   	out    %al,(%dx)
c010193c:	66 c7 45 e2 fc 03    	movw   $0x3fc,-0x1e(%ebp)
c0101942:	c6 45 e1 00          	movb   $0x0,-0x1f(%ebp)
c0101946:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c010194a:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c010194e:	ee                   	out    %al,(%dx)
c010194f:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0101955:	c6 45 dd 01          	movb   $0x1,-0x23(%ebp)
c0101959:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c010195d:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0101961:	ee                   	out    %al,(%dx)
c0101962:	66 c7 45 da fd 03    	movw   $0x3fd,-0x26(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101968:	0f b7 45 da          	movzwl -0x26(%ebp),%eax
c010196c:	66 89 45 c6          	mov    %ax,-0x3a(%ebp)
c0101970:	0f b7 55 c6          	movzwl -0x3a(%ebp),%edx
c0101974:	ec                   	in     (%dx),%al
c0101975:	89 c3                	mov    %eax,%ebx
c0101977:	88 5d d9             	mov    %bl,-0x27(%ebp)
	return data;
c010197a:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
	// Enable rcv interrupts
	outb(COM1 + COM_IER, COM_IER_RDI);

	// Clear any preexisting overrun indications and interrupts
	// Serial port doesn't exist if COM_LSR returns 0xFF
	serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c010197e:	3c ff                	cmp    $0xff,%al
c0101980:	0f 95 c0             	setne  %al
c0101983:	0f b6 c0             	movzbl %al,%eax
c0101986:	a3 e8 ae 11 c0       	mov    %eax,0xc011aee8
c010198b:	66 c7 45 d6 fa 03    	movw   $0x3fa,-0x2a(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101991:	0f b7 45 d6          	movzwl -0x2a(%ebp),%eax
c0101995:	66 89 45 c6          	mov    %ax,-0x3a(%ebp)
c0101999:	0f b7 55 c6          	movzwl -0x3a(%ebp),%edx
c010199d:	ec                   	in     (%dx),%al
c010199e:	89 c3                	mov    %eax,%ebx
c01019a0:	88 5d d5             	mov    %bl,-0x2b(%ebp)
	return data;
c01019a3:	66 c7 45 d2 f8 03    	movw   $0x3f8,-0x2e(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01019a9:	0f b7 45 d2          	movzwl -0x2e(%ebp),%eax
c01019ad:	66 89 45 c6          	mov    %ax,-0x3a(%ebp)
c01019b1:	0f b7 55 c6          	movzwl -0x3a(%ebp),%edx
c01019b5:	ec                   	in     (%dx),%al
c01019b6:	89 c3                	mov    %eax,%ebx
c01019b8:	88 5d d1             	mov    %bl,-0x2f(%ebp)
	(void) inb(COM1+COM_IIR);
	(void) inb(COM1+COM_RX);

	if (serial_exists) {
c01019bb:	a1 e8 ae 11 c0       	mov    0xc011aee8,%eax
c01019c0:	85 c0                	test   %eax,%eax
c01019c2:	74 0c                	je     c01019d0 <serial_init+0xfa>
		pic_enable(IRQ_COM1);
c01019c4:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c01019cb:	e8 28 07 00 00       	call   c01020f8 <pic_enable>
	}
}
c01019d0:	83 c4 54             	add    $0x54,%esp
c01019d3:	5b                   	pop    %ebx
c01019d4:	5d                   	pop    %ebp
c01019d5:	c3                   	ret    

c01019d6 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c01019d6:	55                   	push   %ebp
c01019d7:	89 e5                	mov    %esp,%ebp
c01019d9:	53                   	push   %ebx
c01019da:	83 ec 24             	sub    $0x24,%esp
	int i;
	for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01019dd:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c01019e4:	eb 09                	jmp    c01019ef <lpt_putc_sub+0x19>
		delay();
c01019e6:	e8 83 fd ff ff       	call   c010176e <delay>
}

static void
lpt_putc_sub(int c) {
	int i;
	for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01019eb:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
c01019ef:	66 c7 45 f6 79 03    	movw   $0x379,-0xa(%ebp)
c01019f5:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01019f9:	66 89 45 da          	mov    %ax,-0x26(%ebp)
c01019fd:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101a01:	ec                   	in     (%dx),%al
c0101a02:	89 c3                	mov    %eax,%ebx
c0101a04:	88 5d f5             	mov    %bl,-0xb(%ebp)
	return data;
c0101a07:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101a0b:	84 c0                	test   %al,%al
c0101a0d:	78 09                	js     c0101a18 <lpt_putc_sub+0x42>
c0101a0f:	81 7d f8 ff 31 00 00 	cmpl   $0x31ff,-0x8(%ebp)
c0101a16:	7e ce                	jle    c01019e6 <lpt_putc_sub+0x10>
		delay();
	}
	outb(LPTPORT + 0, c);
c0101a18:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a1b:	0f b6 c0             	movzbl %al,%eax
c0101a1e:	66 c7 45 f2 78 03    	movw   $0x378,-0xe(%ebp)
c0101a24:	88 45 f1             	mov    %al,-0xf(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101a27:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101a2b:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101a2f:	ee                   	out    %al,(%dx)
c0101a30:	66 c7 45 ee 7a 03    	movw   $0x37a,-0x12(%ebp)
c0101a36:	c6 45 ed 0d          	movb   $0xd,-0x13(%ebp)
c0101a3a:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101a3e:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101a42:	ee                   	out    %al,(%dx)
c0101a43:	66 c7 45 ea 7a 03    	movw   $0x37a,-0x16(%ebp)
c0101a49:	c6 45 e9 08          	movb   $0x8,-0x17(%ebp)
c0101a4d:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101a51:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101a55:	ee                   	out    %al,(%dx)
	outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
	outb(LPTPORT + 2, 0x08);
}
c0101a56:	83 c4 24             	add    $0x24,%esp
c0101a59:	5b                   	pop    %ebx
c0101a5a:	5d                   	pop    %ebp
c0101a5b:	c3                   	ret    

c0101a5c <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c0101a5c:	55                   	push   %ebp
c0101a5d:	89 e5                	mov    %esp,%ebp
c0101a5f:	83 ec 04             	sub    $0x4,%esp
	if (c != '\b') {
c0101a62:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101a66:	74 0d                	je     c0101a75 <lpt_putc+0x19>
		lpt_putc_sub(c);
c0101a68:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a6b:	89 04 24             	mov    %eax,(%esp)
c0101a6e:	e8 63 ff ff ff       	call   c01019d6 <lpt_putc_sub>
c0101a73:	eb 24                	jmp    c0101a99 <lpt_putc+0x3d>
	}
	else {
		lpt_putc_sub('\b');
c0101a75:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101a7c:	e8 55 ff ff ff       	call   c01019d6 <lpt_putc_sub>
		lpt_putc_sub(' ');
c0101a81:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101a88:	e8 49 ff ff ff       	call   c01019d6 <lpt_putc_sub>
		lpt_putc_sub('\b');
c0101a8d:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101a94:	e8 3d ff ff ff       	call   c01019d6 <lpt_putc_sub>
	}
}
c0101a99:	c9                   	leave  
c0101a9a:	c3                   	ret    

c0101a9b <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c0101a9b:	55                   	push   %ebp
c0101a9c:	89 e5                	mov    %esp,%ebp
c0101a9e:	53                   	push   %ebx
c0101a9f:	83 ec 34             	sub    $0x34,%esp
	// set black on white
	if (!(c & ~0xFF)) {
c0101aa2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101aa5:	b0 00                	mov    $0x0,%al
c0101aa7:	85 c0                	test   %eax,%eax
c0101aa9:	75 07                	jne    c0101ab2 <cga_putc+0x17>
		c |= 0x0700;
c0101aab:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
	}

	switch (c & 0xff) {
c0101ab2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ab5:	25 ff 00 00 00       	and    $0xff,%eax
c0101aba:	83 f8 0a             	cmp    $0xa,%eax
c0101abd:	74 4f                	je     c0101b0e <cga_putc+0x73>
c0101abf:	83 f8 0d             	cmp    $0xd,%eax
c0101ac2:	74 5a                	je     c0101b1e <cga_putc+0x83>
c0101ac4:	83 f8 08             	cmp    $0x8,%eax
c0101ac7:	0f 85 8d 00 00 00    	jne    c0101b5a <cga_putc+0xbf>
	case '\b':
		if (crt_pos > 0) {
c0101acd:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101ad4:	66 85 c0             	test   %ax,%ax
c0101ad7:	0f 84 a3 00 00 00    	je     c0101b80 <cga_putc+0xe5>
			crt_pos --;
c0101add:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101ae4:	83 e8 01             	sub    $0x1,%eax
c0101ae7:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
			crt_buf[crt_pos] = (c & ~0xff) | ' ';
c0101aed:	a1 e0 ae 11 c0       	mov    0xc011aee0,%eax
c0101af2:	0f b7 15 e4 ae 11 c0 	movzwl 0xc011aee4,%edx
c0101af9:	0f b7 d2             	movzwl %dx,%edx
c0101afc:	01 d2                	add    %edx,%edx
c0101afe:	8d 14 10             	lea    (%eax,%edx,1),%edx
c0101b01:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b04:	b0 00                	mov    $0x0,%al
c0101b06:	83 c8 20             	or     $0x20,%eax
c0101b09:	66 89 02             	mov    %ax,(%edx)
		}
		break;
c0101b0c:	eb 73                	jmp    c0101b81 <cga_putc+0xe6>
	case '\n':
		crt_pos += CRT_COLS;
c0101b0e:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101b15:	83 c0 50             	add    $0x50,%eax
c0101b18:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
	case '\r':
		crt_pos -= (crt_pos % CRT_COLS);
c0101b1e:	0f b7 1d e4 ae 11 c0 	movzwl 0xc011aee4,%ebx
c0101b25:	0f b7 0d e4 ae 11 c0 	movzwl 0xc011aee4,%ecx
c0101b2c:	0f b7 c1             	movzwl %cx,%eax
c0101b2f:	69 c0 cd cc 00 00    	imul   $0xcccd,%eax,%eax
c0101b35:	c1 e8 10             	shr    $0x10,%eax
c0101b38:	89 c2                	mov    %eax,%edx
c0101b3a:	66 c1 ea 06          	shr    $0x6,%dx
c0101b3e:	89 d0                	mov    %edx,%eax
c0101b40:	c1 e0 02             	shl    $0x2,%eax
c0101b43:	01 d0                	add    %edx,%eax
c0101b45:	c1 e0 04             	shl    $0x4,%eax
c0101b48:	89 ca                	mov    %ecx,%edx
c0101b4a:	66 29 c2             	sub    %ax,%dx
c0101b4d:	89 d8                	mov    %ebx,%eax
c0101b4f:	66 29 d0             	sub    %dx,%ax
c0101b52:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
		break;
c0101b58:	eb 27                	jmp    c0101b81 <cga_putc+0xe6>
	default:
		crt_buf[crt_pos ++] = c;     // write the character
c0101b5a:	8b 15 e0 ae 11 c0    	mov    0xc011aee0,%edx
c0101b60:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101b67:	0f b7 c8             	movzwl %ax,%ecx
c0101b6a:	01 c9                	add    %ecx,%ecx
c0101b6c:	8d 0c 0a             	lea    (%edx,%ecx,1),%ecx
c0101b6f:	8b 55 08             	mov    0x8(%ebp),%edx
c0101b72:	66 89 11             	mov    %dx,(%ecx)
c0101b75:	83 c0 01             	add    $0x1,%eax
c0101b78:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
		break;
c0101b7e:	eb 01                	jmp    c0101b81 <cga_putc+0xe6>
	case '\b':
		if (crt_pos > 0) {
			crt_pos --;
			crt_buf[crt_pos] = (c & ~0xff) | ' ';
		}
		break;
c0101b80:	90                   	nop
		crt_buf[crt_pos ++] = c;     // write the character
		break;
	}

	// What is the purpose of this?
	if (crt_pos >= CRT_SIZE) {
c0101b81:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101b88:	66 3d cf 07          	cmp    $0x7cf,%ax
c0101b8c:	76 5b                	jbe    c0101be9 <cga_putc+0x14e>
		int i;
		memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c0101b8e:	a1 e0 ae 11 c0       	mov    0xc011aee0,%eax
c0101b93:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c0101b99:	a1 e0 ae 11 c0       	mov    0xc011aee0,%eax
c0101b9e:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
c0101ba5:	00 
c0101ba6:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101baa:	89 04 24             	mov    %eax,(%esp)
c0101bad:	e8 9c 50 00 00       	call   c0106c4e <memmove>
		for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101bb2:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
c0101bb9:	eb 15                	jmp    c0101bd0 <cga_putc+0x135>
			crt_buf[i] = 0x0700 | ' ';
c0101bbb:	a1 e0 ae 11 c0       	mov    0xc011aee0,%eax
c0101bc0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101bc3:	01 d2                	add    %edx,%edx
c0101bc5:	01 d0                	add    %edx,%eax
c0101bc7:	66 c7 00 20 07       	movw   $0x720,(%eax)

	// What is the purpose of this?
	if (crt_pos >= CRT_SIZE) {
		int i;
		memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
		for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101bcc:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0101bd0:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
c0101bd7:	7e e2                	jle    c0101bbb <cga_putc+0x120>
			crt_buf[i] = 0x0700 | ' ';
		}
		crt_pos -= CRT_COLS;
c0101bd9:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101be0:	83 e8 50             	sub    $0x50,%eax
c0101be3:	66 a3 e4 ae 11 c0    	mov    %ax,0xc011aee4
	}

	// move that little blinky thing
	outb(addr_6845, 14);
c0101be9:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c0101bf0:	0f b7 c0             	movzwl %ax,%eax
c0101bf3:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
c0101bf7:	c6 45 f1 0e          	movb   $0xe,-0xf(%ebp)
c0101bfb:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101bff:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101c03:	ee                   	out    %al,(%dx)
	outb(addr_6845 + 1, crt_pos >> 8);
c0101c04:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101c0b:	66 c1 e8 08          	shr    $0x8,%ax
c0101c0f:	0f b6 c0             	movzbl %al,%eax
c0101c12:	0f b7 15 e6 ae 11 c0 	movzwl 0xc011aee6,%edx
c0101c19:	83 c2 01             	add    $0x1,%edx
c0101c1c:	0f b7 d2             	movzwl %dx,%edx
c0101c1f:	66 89 55 ee          	mov    %dx,-0x12(%ebp)
c0101c23:	88 45 ed             	mov    %al,-0x13(%ebp)
c0101c26:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101c2a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101c2e:	ee                   	out    %al,(%dx)
	outb(addr_6845, 15);
c0101c2f:	0f b7 05 e6 ae 11 c0 	movzwl 0xc011aee6,%eax
c0101c36:	0f b7 c0             	movzwl %ax,%eax
c0101c39:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101c3d:	c6 45 e9 0f          	movb   $0xf,-0x17(%ebp)
c0101c41:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101c45:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101c49:	ee                   	out    %al,(%dx)
	outb(addr_6845 + 1, crt_pos);
c0101c4a:	0f b7 05 e4 ae 11 c0 	movzwl 0xc011aee4,%eax
c0101c51:	0f b6 c0             	movzbl %al,%eax
c0101c54:	0f b7 15 e6 ae 11 c0 	movzwl 0xc011aee6,%edx
c0101c5b:	83 c2 01             	add    $0x1,%edx
c0101c5e:	0f b7 d2             	movzwl %dx,%edx
c0101c61:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
c0101c65:	88 45 e5             	mov    %al,-0x1b(%ebp)
c0101c68:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101c6c:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101c70:	ee                   	out    %al,(%dx)
}
c0101c71:	83 c4 34             	add    $0x34,%esp
c0101c74:	5b                   	pop    %ebx
c0101c75:	5d                   	pop    %ebp
c0101c76:	c3                   	ret    

c0101c77 <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c0101c77:	55                   	push   %ebp
c0101c78:	89 e5                	mov    %esp,%ebp
c0101c7a:	53                   	push   %ebx
c0101c7b:	83 ec 14             	sub    $0x14,%esp
    int i;
	for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101c7e:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c0101c85:	eb 09                	jmp    c0101c90 <serial_putc_sub+0x19>
		delay();
c0101c87:	e8 e2 fa ff ff       	call   c010176e <delay>
}

static void
serial_putc_sub(int c) {
    int i;
	for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101c8c:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
c0101c90:	66 c7 45 f6 fd 03    	movw   $0x3fd,-0xa(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101c96:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101c9a:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101c9e:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101ca2:	ec                   	in     (%dx),%al
c0101ca3:	89 c3                	mov    %eax,%ebx
c0101ca5:	88 5d f5             	mov    %bl,-0xb(%ebp)
	return data;
c0101ca8:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101cac:	0f b6 c0             	movzbl %al,%eax
c0101caf:	83 e0 20             	and    $0x20,%eax
c0101cb2:	85 c0                	test   %eax,%eax
c0101cb4:	75 09                	jne    c0101cbf <serial_putc_sub+0x48>
c0101cb6:	81 7d f8 ff 31 00 00 	cmpl   $0x31ff,-0x8(%ebp)
c0101cbd:	7e c8                	jle    c0101c87 <serial_putc_sub+0x10>
		delay();
	}
	outb(COM1 + COM_TX, c);
c0101cbf:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cc2:	0f b6 c0             	movzbl %al,%eax
c0101cc5:	66 c7 45 f2 f8 03    	movw   $0x3f8,-0xe(%ebp)
c0101ccb:	88 45 f1             	mov    %al,-0xf(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101cce:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101cd2:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101cd6:	ee                   	out    %al,(%dx)
}
c0101cd7:	83 c4 14             	add    $0x14,%esp
c0101cda:	5b                   	pop    %ebx
c0101cdb:	5d                   	pop    %ebp
c0101cdc:	c3                   	ret    

c0101cdd <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c0101cdd:	55                   	push   %ebp
c0101cde:	89 e5                	mov    %esp,%ebp
c0101ce0:	83 ec 04             	sub    $0x4,%esp
	if (c != '\b') {
c0101ce3:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101ce7:	74 0d                	je     c0101cf6 <serial_putc+0x19>
		serial_putc_sub(c);
c0101ce9:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cec:	89 04 24             	mov    %eax,(%esp)
c0101cef:	e8 83 ff ff ff       	call   c0101c77 <serial_putc_sub>
c0101cf4:	eb 24                	jmp    c0101d1a <serial_putc+0x3d>
	}
	else {
		serial_putc_sub('\b');
c0101cf6:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101cfd:	e8 75 ff ff ff       	call   c0101c77 <serial_putc_sub>
		serial_putc_sub(' ');
c0101d02:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101d09:	e8 69 ff ff ff       	call   c0101c77 <serial_putc_sub>
		serial_putc_sub('\b');
c0101d0e:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101d15:	e8 5d ff ff ff       	call   c0101c77 <serial_putc_sub>
	}
}
c0101d1a:	c9                   	leave  
c0101d1b:	c3                   	ret    

c0101d1c <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c0101d1c:	55                   	push   %ebp
c0101d1d:	89 e5                	mov    %esp,%ebp
c0101d1f:	83 ec 18             	sub    $0x18,%esp
	int c;
	while ((c = (*proc)()) != -1) {
c0101d22:	eb 32                	jmp    c0101d56 <cons_intr+0x3a>
		if (c != 0) {
c0101d24:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101d28:	74 2c                	je     c0101d56 <cons_intr+0x3a>
			cons.buf[cons.wpos ++] = c;
c0101d2a:	a1 04 b1 11 c0       	mov    0xc011b104,%eax
c0101d2f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101d32:	88 90 00 af 11 c0    	mov    %dl,-0x3fee5100(%eax)
c0101d38:	83 c0 01             	add    $0x1,%eax
c0101d3b:	a3 04 b1 11 c0       	mov    %eax,0xc011b104
			if (cons.wpos == CONSBUFSIZE) {
c0101d40:	a1 04 b1 11 c0       	mov    0xc011b104,%eax
c0101d45:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101d4a:	75 0a                	jne    c0101d56 <cons_intr+0x3a>
				cons.wpos = 0;
c0101d4c:	c7 05 04 b1 11 c0 00 	movl   $0x0,0xc011b104
c0101d53:	00 00 00 
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
	int c;
	while ((c = (*proc)()) != -1) {
c0101d56:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d59:	ff d0                	call   *%eax
c0101d5b:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101d5e:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c0101d62:	75 c0                	jne    c0101d24 <cons_intr+0x8>
			if (cons.wpos == CONSBUFSIZE) {
				cons.wpos = 0;
			}
		}
	}
}
c0101d64:	c9                   	leave  
c0101d65:	c3                   	ret    

c0101d66 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c0101d66:	55                   	push   %ebp
c0101d67:	89 e5                	mov    %esp,%ebp
c0101d69:	53                   	push   %ebx
c0101d6a:	83 ec 14             	sub    $0x14,%esp
c0101d6d:	66 c7 45 f6 fd 03    	movw   $0x3fd,-0xa(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101d73:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101d77:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101d7b:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101d7f:	ec                   	in     (%dx),%al
c0101d80:	89 c3                	mov    %eax,%ebx
c0101d82:	88 5d f5             	mov    %bl,-0xb(%ebp)
	return data;
c0101d85:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
	if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c0101d89:	0f b6 c0             	movzbl %al,%eax
c0101d8c:	83 e0 01             	and    $0x1,%eax
c0101d8f:	85 c0                	test   %eax,%eax
c0101d91:	75 07                	jne    c0101d9a <serial_proc_data+0x34>
		return -1;
c0101d93:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101d98:	eb 32                	jmp    c0101dcc <serial_proc_data+0x66>
c0101d9a:	66 c7 45 f2 f8 03    	movw   $0x3f8,-0xe(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101da0:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101da4:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101da8:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101dac:	ec                   	in     (%dx),%al
c0101dad:	89 c3                	mov    %eax,%ebx
c0101daf:	88 5d f1             	mov    %bl,-0xf(%ebp)
	return data;
c0101db2:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
	}
	int c = inb(COM1 + COM_RX);
c0101db6:	0f b6 c0             	movzbl %al,%eax
c0101db9:	89 45 f8             	mov    %eax,-0x8(%ebp)
	if (c == 127) {
c0101dbc:	83 7d f8 7f          	cmpl   $0x7f,-0x8(%ebp)
c0101dc0:	75 07                	jne    c0101dc9 <serial_proc_data+0x63>
		c = '\b';
c0101dc2:	c7 45 f8 08 00 00 00 	movl   $0x8,-0x8(%ebp)
	}
	return c;
c0101dc9:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0101dcc:	83 c4 14             	add    $0x14,%esp
c0101dcf:	5b                   	pop    %ebx
c0101dd0:	5d                   	pop    %ebp
c0101dd1:	c3                   	ret    

c0101dd2 <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c0101dd2:	55                   	push   %ebp
c0101dd3:	89 e5                	mov    %esp,%ebp
c0101dd5:	83 ec 18             	sub    $0x18,%esp
	if (serial_exists) {
c0101dd8:	a1 e8 ae 11 c0       	mov    0xc011aee8,%eax
c0101ddd:	85 c0                	test   %eax,%eax
c0101ddf:	74 0c                	je     c0101ded <serial_intr+0x1b>
		cons_intr(serial_proc_data);
c0101de1:	c7 04 24 66 1d 10 c0 	movl   $0xc0101d66,(%esp)
c0101de8:	e8 2f ff ff ff       	call   c0101d1c <cons_intr>
	}
}
c0101ded:	c9                   	leave  
c0101dee:	c3                   	ret    

c0101def <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c0101def:	55                   	push   %ebp
c0101df0:	89 e5                	mov    %esp,%ebp
c0101df2:	53                   	push   %ebx
c0101df3:	83 ec 44             	sub    $0x44,%esp
c0101df6:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101dfc:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c0101e00:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
c0101e04:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101e08:	ec                   	in     (%dx),%al
c0101e09:	89 c3                	mov    %eax,%ebx
c0101e0b:	88 5d ef             	mov    %bl,-0x11(%ebp)
	return data;
c0101e0e:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
	int c;
	uint8_t data;
	static uint32_t shift;

	if ((inb(KBSTATP) & KBS_DIB) == 0) {
c0101e12:	0f b6 c0             	movzbl %al,%eax
c0101e15:	83 e0 01             	and    $0x1,%eax
c0101e18:	85 c0                	test   %eax,%eax
c0101e1a:	75 0a                	jne    c0101e26 <kbd_proc_data+0x37>
		return -1;
c0101e1c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101e21:	e9 62 01 00 00       	jmp    c0101f88 <kbd_proc_data+0x199>
c0101e26:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
	uint8_t data;
	asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101e2c:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0101e30:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
c0101e34:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101e38:	ec                   	in     (%dx),%al
c0101e39:	89 c3                	mov    %eax,%ebx
c0101e3b:	88 5d eb             	mov    %bl,-0x15(%ebp)
	return data;
c0101e3e:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
	}

	data = inb(KBDATAP);
c0101e42:	88 45 f3             	mov    %al,-0xd(%ebp)

	if (data == 0xE0) {
c0101e45:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
c0101e49:	75 17                	jne    c0101e62 <kbd_proc_data+0x73>
		// E0 escape character
		shift |= E0ESC;
c0101e4b:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101e50:	83 c8 40             	or     $0x40,%eax
c0101e53:	a3 08 b1 11 c0       	mov    %eax,0xc011b108
		return 0;
c0101e58:	b8 00 00 00 00       	mov    $0x0,%eax
c0101e5d:	e9 26 01 00 00       	jmp    c0101f88 <kbd_proc_data+0x199>
	} else if (data & 0x80) {
c0101e62:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101e66:	84 c0                	test   %al,%al
c0101e68:	79 47                	jns    c0101eb1 <kbd_proc_data+0xc2>
		// Key released
		data = (shift & E0ESC ? data : data & 0x7F);
c0101e6a:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101e6f:	83 e0 40             	and    $0x40,%eax
c0101e72:	85 c0                	test   %eax,%eax
c0101e74:	75 09                	jne    c0101e7f <kbd_proc_data+0x90>
c0101e76:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101e7a:	83 e0 7f             	and    $0x7f,%eax
c0101e7d:	eb 04                	jmp    c0101e83 <kbd_proc_data+0x94>
c0101e7f:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101e83:	88 45 f3             	mov    %al,-0xd(%ebp)
		shift &= ~(shiftcode[data] | E0ESC);
c0101e86:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101e8a:	0f b6 80 c0 a0 11 c0 	movzbl -0x3fee5f40(%eax),%eax
c0101e91:	83 c8 40             	or     $0x40,%eax
c0101e94:	0f b6 c0             	movzbl %al,%eax
c0101e97:	f7 d0                	not    %eax
c0101e99:	89 c2                	mov    %eax,%edx
c0101e9b:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101ea0:	21 d0                	and    %edx,%eax
c0101ea2:	a3 08 b1 11 c0       	mov    %eax,0xc011b108
		return 0;
c0101ea7:	b8 00 00 00 00       	mov    $0x0,%eax
c0101eac:	e9 d7 00 00 00       	jmp    c0101f88 <kbd_proc_data+0x199>
	} else if (shift & E0ESC) {
c0101eb1:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101eb6:	83 e0 40             	and    $0x40,%eax
c0101eb9:	85 c0                	test   %eax,%eax
c0101ebb:	74 11                	je     c0101ece <kbd_proc_data+0xdf>
		// Last character was an E0 escape; or with 0x80
		data |= 0x80;
c0101ebd:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
		shift &= ~E0ESC;
c0101ec1:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101ec6:	83 e0 bf             	and    $0xffffffbf,%eax
c0101ec9:	a3 08 b1 11 c0       	mov    %eax,0xc011b108
	}

	shift |= shiftcode[data];
c0101ece:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101ed2:	0f b6 80 c0 a0 11 c0 	movzbl -0x3fee5f40(%eax),%eax
c0101ed9:	0f b6 d0             	movzbl %al,%edx
c0101edc:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101ee1:	09 d0                	or     %edx,%eax
c0101ee3:	a3 08 b1 11 c0       	mov    %eax,0xc011b108
	shift ^= togglecode[data];
c0101ee8:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101eec:	0f b6 80 c0 a1 11 c0 	movzbl -0x3fee5e40(%eax),%eax
c0101ef3:	0f b6 d0             	movzbl %al,%edx
c0101ef6:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101efb:	31 d0                	xor    %edx,%eax
c0101efd:	a3 08 b1 11 c0       	mov    %eax,0xc011b108

	c = charcode[shift & (CTL | SHIFT)][data];
c0101f02:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101f07:	83 e0 03             	and    $0x3,%eax
c0101f0a:	8b 14 85 c0 a5 11 c0 	mov    -0x3fee5a40(,%eax,4),%edx
c0101f11:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101f15:	8d 04 02             	lea    (%edx,%eax,1),%eax
c0101f18:	0f b6 00             	movzbl (%eax),%eax
c0101f1b:	0f b6 c0             	movzbl %al,%eax
c0101f1e:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (shift & CAPSLOCK) {
c0101f21:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101f26:	83 e0 08             	and    $0x8,%eax
c0101f29:	85 c0                	test   %eax,%eax
c0101f2b:	74 22                	je     c0101f4f <kbd_proc_data+0x160>
		if ('a' <= c && c <= 'z')
c0101f2d:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
c0101f31:	7e 0c                	jle    c0101f3f <kbd_proc_data+0x150>
c0101f33:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
c0101f37:	7f 06                	jg     c0101f3f <kbd_proc_data+0x150>
			c += 'A' - 'a';
c0101f39:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
c0101f3d:	eb 10                	jmp    c0101f4f <kbd_proc_data+0x160>
		else if ('A' <= c && c <= 'Z')
c0101f3f:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
c0101f43:	7e 0a                	jle    c0101f4f <kbd_proc_data+0x160>
c0101f45:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
c0101f49:	7f 04                	jg     c0101f4f <kbd_proc_data+0x160>
			c += 'a' - 'A';
c0101f4b:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
	}

	// Process special keys
	// Ctrl-Alt-Del: reboot
	if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c0101f4f:	a1 08 b1 11 c0       	mov    0xc011b108,%eax
c0101f54:	f7 d0                	not    %eax
c0101f56:	83 e0 06             	and    $0x6,%eax
c0101f59:	85 c0                	test   %eax,%eax
c0101f5b:	75 28                	jne    c0101f85 <kbd_proc_data+0x196>
c0101f5d:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
c0101f64:	75 1f                	jne    c0101f85 <kbd_proc_data+0x196>
		cprintf("Rebooting!\n");
c0101f66:	c7 04 24 d4 75 10 c0 	movl   $0xc01075d4,(%esp)
c0101f6d:	e8 3e e2 ff ff       	call   c01001b0 <cprintf>
c0101f72:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
c0101f78:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101f7c:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
c0101f80:	0f b7 55 e8          	movzwl -0x18(%ebp),%edx
c0101f84:	ee                   	out    %al,(%dx)
		outb(0x92, 0x3); // courtesy of Chris Frost
	}
	return c;
c0101f85:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101f88:	83 c4 44             	add    $0x44,%esp
c0101f8b:	5b                   	pop    %ebx
c0101f8c:	5d                   	pop    %ebp
c0101f8d:	c3                   	ret    

c0101f8e <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c0101f8e:	55                   	push   %ebp
c0101f8f:	89 e5                	mov    %esp,%ebp
c0101f91:	83 ec 18             	sub    $0x18,%esp
	cons_intr(kbd_proc_data);
c0101f94:	c7 04 24 ef 1d 10 c0 	movl   $0xc0101def,(%esp)
c0101f9b:	e8 7c fd ff ff       	call   c0101d1c <cons_intr>
}
c0101fa0:	c9                   	leave  
c0101fa1:	c3                   	ret    

c0101fa2 <kbd_init>:

static void
kbd_init(void) {
c0101fa2:	55                   	push   %ebp
c0101fa3:	89 e5                	mov    %esp,%ebp
c0101fa5:	83 ec 18             	sub    $0x18,%esp
	// drain the kbd buffer
	kbd_intr();
c0101fa8:	e8 e1 ff ff ff       	call   c0101f8e <kbd_intr>
	pic_enable(IRQ_KBD);
c0101fad:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0101fb4:	e8 3f 01 00 00       	call   c01020f8 <pic_enable>
}
c0101fb9:	c9                   	leave  
c0101fba:	c3                   	ret    

c0101fbb <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c0101fbb:	55                   	push   %ebp
c0101fbc:	89 e5                	mov    %esp,%ebp
c0101fbe:	83 ec 18             	sub    $0x18,%esp
	cga_init();
c0101fc1:	e8 15 f8 ff ff       	call   c01017db <cga_init>
	serial_init();
c0101fc6:	e8 0b f9 ff ff       	call   c01018d6 <serial_init>
	kbd_init();
c0101fcb:	e8 d2 ff ff ff       	call   c0101fa2 <kbd_init>
	if (!serial_exists) {
c0101fd0:	a1 e8 ae 11 c0       	mov    0xc011aee8,%eax
c0101fd5:	85 c0                	test   %eax,%eax
c0101fd7:	75 0c                	jne    c0101fe5 <cons_init+0x2a>
		cprintf("serial port does not exist!!\n");
c0101fd9:	c7 04 24 e0 75 10 c0 	movl   $0xc01075e0,(%esp)
c0101fe0:	e8 cb e1 ff ff       	call   c01001b0 <cprintf>
	}
}
c0101fe5:	c9                   	leave  
c0101fe6:	c3                   	ret    

c0101fe7 <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c0101fe7:	55                   	push   %ebp
c0101fe8:	89 e5                	mov    %esp,%ebp
c0101fea:	83 ec 28             	sub    $0x28,%esp
	bool intr_flag;
	local_intr_save(intr_flag);
c0101fed:	e8 3a f7 ff ff       	call   c010172c <__intr_save>
c0101ff2:	89 45 f4             	mov    %eax,-0xc(%ebp)
	{
		lpt_putc(c);
c0101ff5:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ff8:	89 04 24             	mov    %eax,(%esp)
c0101ffb:	e8 5c fa ff ff       	call   c0101a5c <lpt_putc>
		cga_putc(c);
c0102000:	8b 45 08             	mov    0x8(%ebp),%eax
c0102003:	89 04 24             	mov    %eax,(%esp)
c0102006:	e8 90 fa ff ff       	call   c0101a9b <cga_putc>
		serial_putc(c);
c010200b:	8b 45 08             	mov    0x8(%ebp),%eax
c010200e:	89 04 24             	mov    %eax,(%esp)
c0102011:	e8 c7 fc ff ff       	call   c0101cdd <serial_putc>
	}
	local_intr_restore(intr_flag);
c0102016:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102019:	89 04 24             	mov    %eax,(%esp)
c010201c:	e8 3a f7 ff ff       	call   c010175b <__intr_restore>
}
c0102021:	c9                   	leave  
c0102022:	c3                   	ret    

c0102023 <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c0102023:	55                   	push   %ebp
c0102024:	89 e5                	mov    %esp,%ebp
c0102026:	83 ec 28             	sub    $0x28,%esp
	int c = 0;
c0102029:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	bool intr_flag;
	local_intr_save(intr_flag);
c0102030:	e8 f7 f6 ff ff       	call   c010172c <__intr_save>
c0102035:	89 45 f0             	mov    %eax,-0x10(%ebp)
	{
		// poll for any pending input characters,
		// so that this function works even when interrupts are disabled
		// (e.g., when called from the kernel monitor).
		serial_intr();
c0102038:	e8 95 fd ff ff       	call   c0101dd2 <serial_intr>
		kbd_intr();
c010203d:	e8 4c ff ff ff       	call   c0101f8e <kbd_intr>

		// grab the next character from the input buffer.
		if (cons.rpos != cons.wpos) {
c0102042:	8b 15 00 b1 11 c0    	mov    0xc011b100,%edx
c0102048:	a1 04 b1 11 c0       	mov    0xc011b104,%eax
c010204d:	39 c2                	cmp    %eax,%edx
c010204f:	74 30                	je     c0102081 <cons_getc+0x5e>
			c = cons.buf[cons.rpos ++];
c0102051:	a1 00 b1 11 c0       	mov    0xc011b100,%eax
c0102056:	0f b6 90 00 af 11 c0 	movzbl -0x3fee5100(%eax),%edx
c010205d:	0f b6 d2             	movzbl %dl,%edx
c0102060:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0102063:	83 c0 01             	add    $0x1,%eax
c0102066:	a3 00 b1 11 c0       	mov    %eax,0xc011b100
			if (cons.rpos == CONSBUFSIZE) {
c010206b:	a1 00 b1 11 c0       	mov    0xc011b100,%eax
c0102070:	3d 00 02 00 00       	cmp    $0x200,%eax
c0102075:	75 0a                	jne    c0102081 <cons_getc+0x5e>
				cons.rpos = 0;
c0102077:	c7 05 00 b1 11 c0 00 	movl   $0x0,0xc011b100
c010207e:	00 00 00 
			}
		}
	}
	local_intr_restore(intr_flag);
c0102081:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102084:	89 04 24             	mov    %eax,(%esp)
c0102087:	e8 cf f6 ff ff       	call   c010175b <__intr_restore>
	return c;
c010208c:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010208f:	c9                   	leave  
c0102090:	c3                   	ret    
c0102091:	00 00                	add    %al,(%eax)
	...

c0102094 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c0102094:	55                   	push   %ebp
c0102095:	89 e5                	mov    %esp,%ebp
	asm volatile ("lidt (%0)" :: "r" (pd));
}

static inline void
sti(void) {
	asm volatile ("sti");
c0102097:	fb                   	sti    
	sti();
}
c0102098:	5d                   	pop    %ebp
c0102099:	c3                   	ret    

c010209a <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c010209a:	55                   	push   %ebp
c010209b:	89 e5                	mov    %esp,%ebp
}

static inline void
cli(void) {
	asm volatile ("cli");
c010209d:	fa                   	cli    
	cli();
}
c010209e:	5d                   	pop    %ebp
c010209f:	c3                   	ret    

c01020a0 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c01020a0:	55                   	push   %ebp
c01020a1:	89 e5                	mov    %esp,%ebp
c01020a3:	83 ec 14             	sub    $0x14,%esp
c01020a6:	8b 45 08             	mov    0x8(%ebp),%eax
c01020a9:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
	irq_mask = mask;
c01020ad:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01020b1:	66 a3 d0 a5 11 c0    	mov    %ax,0xc011a5d0
	if (did_init) {
c01020b7:	a1 0c b1 11 c0       	mov    0xc011b10c,%eax
c01020bc:	85 c0                	test   %eax,%eax
c01020be:	74 36                	je     c01020f6 <pic_setmask+0x56>
		outb(IO_PIC1 + 1, mask);
c01020c0:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01020c4:	0f b6 c0             	movzbl %al,%eax
c01020c7:	66 c7 45 fe 21 00    	movw   $0x21,-0x2(%ebp)
c01020cd:	88 45 fd             	mov    %al,-0x3(%ebp)
			: "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
	asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c01020d0:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c01020d4:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c01020d8:	ee                   	out    %al,(%dx)
		outb(IO_PIC2 + 1, mask >> 8);
c01020d9:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01020dd:	66 c1 e8 08          	shr    $0x8,%ax
c01020e1:	0f b6 c0             	movzbl %al,%eax
c01020e4:	66 c7 45 fa a1 00    	movw   $0xa1,-0x6(%ebp)
c01020ea:	88 45 f9             	mov    %al,-0x7(%ebp)
c01020ed:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01020f1:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01020f5:	ee                   	out    %al,(%dx)
	}
}
c01020f6:	c9                   	leave  
c01020f7:	c3                   	ret    

c01020f8 <pic_enable>:

void
pic_enable(unsigned int irq) {
c01020f8:	55                   	push   %ebp
c01020f9:	89 e5                	mov    %esp,%ebp
c01020fb:	53                   	push   %ebx
c01020fc:	83 ec 04             	sub    $0x4,%esp
	pic_setmask(irq_mask & ~(1 << irq));
c01020ff:	8b 45 08             	mov    0x8(%ebp),%eax
c0102102:	ba 01 00 00 00       	mov    $0x1,%edx
c0102107:	89 d3                	mov    %edx,%ebx
c0102109:	89 c1                	mov    %eax,%ecx
c010210b:	d3 e3                	shl    %cl,%ebx
c010210d:	89 d8                	mov    %ebx,%eax
c010210f:	89 c2                	mov    %eax,%edx
c0102111:	f7 d2                	not    %edx
c0102113:	0f b7 05 d0 a5 11 c0 	movzwl 0xc011a5d0,%eax
c010211a:	21 d0                	and    %edx,%eax
c010211c:	0f b7 c0             	movzwl %ax,%eax
c010211f:	89 04 24             	mov    %eax,(%esp)
c0102122:	e8 79 ff ff ff       	call   c01020a0 <pic_setmask>
}
c0102127:	83 c4 04             	add    $0x4,%esp
c010212a:	5b                   	pop    %ebx
c010212b:	5d                   	pop    %ebp
c010212c:	c3                   	ret    

c010212d <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c010212d:	55                   	push   %ebp
c010212e:	89 e5                	mov    %esp,%ebp
c0102130:	83 ec 44             	sub    $0x44,%esp
	did_init = 1;
c0102133:	c7 05 0c b1 11 c0 01 	movl   $0x1,0xc011b10c
c010213a:	00 00 00 
c010213d:	66 c7 45 fe 21 00    	movw   $0x21,-0x2(%ebp)
c0102143:	c6 45 fd ff          	movb   $0xff,-0x3(%ebp)
c0102147:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c010214b:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c010214f:	ee                   	out    %al,(%dx)
c0102150:	66 c7 45 fa a1 00    	movw   $0xa1,-0x6(%ebp)
c0102156:	c6 45 f9 ff          	movb   $0xff,-0x7(%ebp)
c010215a:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c010215e:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0102162:	ee                   	out    %al,(%dx)
c0102163:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c0102169:	c6 45 f5 11          	movb   $0x11,-0xb(%ebp)
c010216d:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0102171:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0102175:	ee                   	out    %al,(%dx)
c0102176:	66 c7 45 f2 21 00    	movw   $0x21,-0xe(%ebp)
c010217c:	c6 45 f1 20          	movb   $0x20,-0xf(%ebp)
c0102180:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0102184:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0102188:	ee                   	out    %al,(%dx)
c0102189:	66 c7 45 ee 21 00    	movw   $0x21,-0x12(%ebp)
c010218f:	c6 45 ed 04          	movb   $0x4,-0x13(%ebp)
c0102193:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0102197:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010219b:	ee                   	out    %al,(%dx)
c010219c:	66 c7 45 ea 21 00    	movw   $0x21,-0x16(%ebp)
c01021a2:	c6 45 e9 03          	movb   $0x3,-0x17(%ebp)
c01021a6:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01021aa:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01021ae:	ee                   	out    %al,(%dx)
c01021af:	66 c7 45 e6 a0 00    	movw   $0xa0,-0x1a(%ebp)
c01021b5:	c6 45 e5 11          	movb   $0x11,-0x1b(%ebp)
c01021b9:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01021bd:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01021c1:	ee                   	out    %al,(%dx)
c01021c2:	66 c7 45 e2 a1 00    	movw   $0xa1,-0x1e(%ebp)
c01021c8:	c6 45 e1 28          	movb   $0x28,-0x1f(%ebp)
c01021cc:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01021d0:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01021d4:	ee                   	out    %al,(%dx)
c01021d5:	66 c7 45 de a1 00    	movw   $0xa1,-0x22(%ebp)
c01021db:	c6 45 dd 02          	movb   $0x2,-0x23(%ebp)
c01021df:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01021e3:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01021e7:	ee                   	out    %al,(%dx)
c01021e8:	66 c7 45 da a1 00    	movw   $0xa1,-0x26(%ebp)
c01021ee:	c6 45 d9 03          	movb   $0x3,-0x27(%ebp)
c01021f2:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c01021f6:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c01021fa:	ee                   	out    %al,(%dx)
c01021fb:	66 c7 45 d6 20 00    	movw   $0x20,-0x2a(%ebp)
c0102201:	c6 45 d5 68          	movb   $0x68,-0x2b(%ebp)
c0102205:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0102209:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c010220d:	ee                   	out    %al,(%dx)
c010220e:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c0102214:	c6 45 d1 0a          	movb   $0xa,-0x2f(%ebp)
c0102218:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c010221c:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0102220:	ee                   	out    %al,(%dx)
c0102221:	66 c7 45 ce a0 00    	movw   $0xa0,-0x32(%ebp)
c0102227:	c6 45 cd 68          	movb   $0x68,-0x33(%ebp)
c010222b:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c010222f:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c0102233:	ee                   	out    %al,(%dx)
c0102234:	66 c7 45 ca a0 00    	movw   $0xa0,-0x36(%ebp)
c010223a:	c6 45 c9 0a          	movb   $0xa,-0x37(%ebp)
c010223e:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c0102242:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0102246:	ee                   	out    %al,(%dx)
	outb(IO_PIC1, 0x0a);	// read IRR by default

	outb(IO_PIC2, 0x68);	// OCW3
	outb(IO_PIC2, 0x0a);	// OCW3

	if (irq_mask != 0xFFFF) {
c0102247:	0f b7 05 d0 a5 11 c0 	movzwl 0xc011a5d0,%eax
c010224e:	66 83 f8 ff          	cmp    $0xffffffff,%ax
c0102252:	74 12                	je     c0102266 <pic_init+0x139>
		pic_setmask(irq_mask);
c0102254:	0f b7 05 d0 a5 11 c0 	movzwl 0xc011a5d0,%eax
c010225b:	0f b7 c0             	movzwl %ax,%eax
c010225e:	89 04 24             	mov    %eax,(%esp)
c0102261:	e8 3a fe ff ff       	call   c01020a0 <pic_setmask>
	}
}
c0102266:	c9                   	leave  
c0102267:	c3                   	ret    

c0102268 <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
c0102268:	55                   	push   %ebp
c0102269:	89 e5                	mov    %esp,%ebp
c010226b:	83 ec 18             	sub    $0x18,%esp
	cprintf("%d ticks\n",TICK_NUM);
c010226e:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
c0102275:	00 
c0102276:	c7 04 24 00 76 10 c0 	movl   $0xc0107600,(%esp)
c010227d:	e8 2e df ff ff       	call   c01001b0 <cprintf>
#ifdef DEBUG_GRADE
	cprintf("End of Test.\n");
	panic("EOT: kernel seems ok.");
#endif
}
c0102282:	c9                   	leave  
c0102283:	c3                   	ret    

c0102284 <idt_init>:
static struct pseudodesc idt_pd = {
	sizeof(idt) - 1, (uint32_t)idt
};

void
idt_init(void) {
c0102284:	55                   	push   %ebp
c0102285:	89 e5                	mov    %esp,%ebp
c0102287:	83 ec 10             	sub    $0x10,%esp
	/* LAB1 2008010486 */
	extern uintptr_t __vectors[];
	int i;
	for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c010228a:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0102291:	e9 c3 00 00 00       	jmp    c0102359 <idt_init+0xd5>
			SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
c0102296:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102299:	8b 04 85 60 a6 11 c0 	mov    -0x3fee59a0(,%eax,4),%eax
c01022a0:	89 c2                	mov    %eax,%edx
c01022a2:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022a5:	66 89 14 c5 20 b1 11 	mov    %dx,-0x3fee4ee0(,%eax,8)
c01022ac:	c0 
c01022ad:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022b0:	66 c7 04 c5 22 b1 11 	movw   $0x8,-0x3fee4ede(,%eax,8)
c01022b7:	c0 08 00 
c01022ba:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022bd:	0f b6 14 c5 24 b1 11 	movzbl -0x3fee4edc(,%eax,8),%edx
c01022c4:	c0 
c01022c5:	83 e2 e0             	and    $0xffffffe0,%edx
c01022c8:	88 14 c5 24 b1 11 c0 	mov    %dl,-0x3fee4edc(,%eax,8)
c01022cf:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022d2:	0f b6 14 c5 24 b1 11 	movzbl -0x3fee4edc(,%eax,8),%edx
c01022d9:	c0 
c01022da:	83 e2 1f             	and    $0x1f,%edx
c01022dd:	88 14 c5 24 b1 11 c0 	mov    %dl,-0x3fee4edc(,%eax,8)
c01022e4:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022e7:	0f b6 14 c5 25 b1 11 	movzbl -0x3fee4edb(,%eax,8),%edx
c01022ee:	c0 
c01022ef:	83 e2 f0             	and    $0xfffffff0,%edx
c01022f2:	83 ca 0e             	or     $0xe,%edx
c01022f5:	88 14 c5 25 b1 11 c0 	mov    %dl,-0x3fee4edb(,%eax,8)
c01022fc:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01022ff:	0f b6 14 c5 25 b1 11 	movzbl -0x3fee4edb(,%eax,8),%edx
c0102306:	c0 
c0102307:	83 e2 ef             	and    $0xffffffef,%edx
c010230a:	88 14 c5 25 b1 11 c0 	mov    %dl,-0x3fee4edb(,%eax,8)
c0102311:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102314:	0f b6 14 c5 25 b1 11 	movzbl -0x3fee4edb(,%eax,8),%edx
c010231b:	c0 
c010231c:	83 e2 9f             	and    $0xffffff9f,%edx
c010231f:	88 14 c5 25 b1 11 c0 	mov    %dl,-0x3fee4edb(,%eax,8)
c0102326:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102329:	0f b6 14 c5 25 b1 11 	movzbl -0x3fee4edb(,%eax,8),%edx
c0102330:	c0 
c0102331:	83 ca 80             	or     $0xffffff80,%edx
c0102334:	88 14 c5 25 b1 11 c0 	mov    %dl,-0x3fee4edb(,%eax,8)
c010233b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010233e:	8b 04 85 60 a6 11 c0 	mov    -0x3fee59a0(,%eax,4),%eax
c0102345:	c1 e8 10             	shr    $0x10,%eax
c0102348:	89 c2                	mov    %eax,%edx
c010234a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010234d:	66 89 14 c5 26 b1 11 	mov    %dx,-0x3fee4eda(,%eax,8)
c0102354:	c0 
void
idt_init(void) {
	/* LAB1 2008010486 */
	extern uintptr_t __vectors[];
	int i;
	for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c0102355:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0102359:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010235c:	3d ff 00 00 00       	cmp    $0xff,%eax
c0102361:	0f 86 2f ff ff ff    	jbe    c0102296 <idt_init+0x12>
c0102367:	c7 45 f8 e0 a5 11 c0 	movl   $0xc011a5e0,-0x8(%ebp)
	}
}

static inline void
lidt(struct pseudodesc *pd) {
	asm volatile ("lidt (%0)" :: "r" (pd));
c010236e:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102371:	0f 01 18             	lidtl  (%eax)
			SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
	}
	lidt(&idt_pd);
}
c0102374:	c9                   	leave  
c0102375:	c3                   	ret    

c0102376 <trapname>:

static const char *
trapname(int trapno) {
c0102376:	55                   	push   %ebp
c0102377:	89 e5                	mov    %esp,%ebp
		"Alignment Check",
		"Machine-Check",
		"SIMD Floating-Point Exception"
	};

	if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c0102379:	8b 45 08             	mov    0x8(%ebp),%eax
c010237c:	83 f8 13             	cmp    $0x13,%eax
c010237f:	77 0c                	ja     c010238d <trapname+0x17>
		return excnames[trapno];
c0102381:	8b 45 08             	mov    0x8(%ebp),%eax
c0102384:	8b 04 85 c0 79 10 c0 	mov    -0x3fef8640(,%eax,4),%eax
c010238b:	eb 18                	jmp    c01023a5 <trapname+0x2f>
	}
	if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c010238d:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c0102391:	7e 0d                	jle    c01023a0 <trapname+0x2a>
c0102393:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c0102397:	7f 07                	jg     c01023a0 <trapname+0x2a>
		return "Hardware Interrupt";
c0102399:	b8 0a 76 10 c0       	mov    $0xc010760a,%eax
c010239e:	eb 05                	jmp    c01023a5 <trapname+0x2f>
	}
	return "(unknown trap)";
c01023a0:	b8 1d 76 10 c0       	mov    $0xc010761d,%eax
}
c01023a5:	5d                   	pop    %ebp
c01023a6:	c3                   	ret    

c01023a7 <trap_in_kernel>:

bool
trap_in_kernel(struct trapframe *tf) {
c01023a7:	55                   	push   %ebp
c01023a8:	89 e5                	mov    %esp,%ebp
	return (tf->tf_cs == (uint16_t)KERNEL_CS);
c01023aa:	8b 45 08             	mov    0x8(%ebp),%eax
c01023ad:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c01023b1:	66 83 f8 08          	cmp    $0x8,%ax
c01023b5:	0f 94 c0             	sete   %al
c01023b8:	0f b6 c0             	movzbl %al,%eax
}
c01023bb:	5d                   	pop    %ebp
c01023bc:	c3                   	ret    

c01023bd <print_trapframe>:
	"TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
	"RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c01023bd:	55                   	push   %ebp
c01023be:	89 e5                	mov    %esp,%ebp
c01023c0:	83 ec 28             	sub    $0x28,%esp
	cprintf("trapframe at %p\n", tf);
c01023c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01023c6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01023ca:	c7 04 24 5e 76 10 c0 	movl   $0xc010765e,(%esp)
c01023d1:	e8 da dd ff ff       	call   c01001b0 <cprintf>
	print_regs(&tf->tf_regs);
c01023d6:	8b 45 08             	mov    0x8(%ebp),%eax
c01023d9:	89 04 24             	mov    %eax,(%esp)
c01023dc:	e8 6d 01 00 00       	call   c010254e <print_regs>
	cprintf("  es   0x----%04x\n", tf->tf_es);
c01023e1:	8b 45 08             	mov    0x8(%ebp),%eax
c01023e4:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c01023e8:	0f b7 c0             	movzwl %ax,%eax
c01023eb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01023ef:	c7 04 24 6f 76 10 c0 	movl   $0xc010766f,(%esp)
c01023f6:	e8 b5 dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  ds   0x----%04x\n", tf->tf_ds);
c01023fb:	8b 45 08             	mov    0x8(%ebp),%eax
c01023fe:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c0102402:	0f b7 c0             	movzwl %ax,%eax
c0102405:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102409:	c7 04 24 82 76 10 c0 	movl   $0xc0107682,(%esp)
c0102410:	e8 9b dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c0102415:	8b 45 08             	mov    0x8(%ebp),%eax
c0102418:	8b 40 28             	mov    0x28(%eax),%eax
c010241b:	89 04 24             	mov    %eax,(%esp)
c010241e:	e8 53 ff ff ff       	call   c0102376 <trapname>
c0102423:	8b 55 08             	mov    0x8(%ebp),%edx
c0102426:	8b 52 28             	mov    0x28(%edx),%edx
c0102429:	89 44 24 08          	mov    %eax,0x8(%esp)
c010242d:	89 54 24 04          	mov    %edx,0x4(%esp)
c0102431:	c7 04 24 95 76 10 c0 	movl   $0xc0107695,(%esp)
c0102438:	e8 73 dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  err  0x%08x\n", tf->tf_err);
c010243d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102440:	8b 40 2c             	mov    0x2c(%eax),%eax
c0102443:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102447:	c7 04 24 a7 76 10 c0 	movl   $0xc01076a7,(%esp)
c010244e:	e8 5d dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  eip  0x%08x\n", tf->tf_eip);
c0102453:	8b 45 08             	mov    0x8(%ebp),%eax
c0102456:	8b 40 30             	mov    0x30(%eax),%eax
c0102459:	89 44 24 04          	mov    %eax,0x4(%esp)
c010245d:	c7 04 24 b6 76 10 c0 	movl   $0xc01076b6,(%esp)
c0102464:	e8 47 dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  cs   0x----%04x\n", tf->tf_cs);
c0102469:	8b 45 08             	mov    0x8(%ebp),%eax
c010246c:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c0102470:	0f b7 c0             	movzwl %ax,%eax
c0102473:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102477:	c7 04 24 c5 76 10 c0 	movl   $0xc01076c5,(%esp)
c010247e:	e8 2d dd ff ff       	call   c01001b0 <cprintf>
	cprintf("  flag 0x%08x ", tf->tf_eflags);
c0102483:	8b 45 08             	mov    0x8(%ebp),%eax
c0102486:	8b 40 38             	mov    0x38(%eax),%eax
c0102489:	89 44 24 04          	mov    %eax,0x4(%esp)
c010248d:	c7 04 24 d8 76 10 c0 	movl   $0xc01076d8,(%esp)
c0102494:	e8 17 dd ff ff       	call   c01001b0 <cprintf>

	int i, j;
	for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0102499:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01024a0:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c01024a7:	eb 3e                	jmp    c01024e7 <print_trapframe+0x12a>
		if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c01024a9:	8b 45 08             	mov    0x8(%ebp),%eax
c01024ac:	8b 50 38             	mov    0x38(%eax),%edx
c01024af:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01024b2:	21 d0                	and    %edx,%eax
c01024b4:	85 c0                	test   %eax,%eax
c01024b6:	74 28                	je     c01024e0 <print_trapframe+0x123>
c01024b8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01024bb:	8b 04 85 00 a6 11 c0 	mov    -0x3fee5a00(,%eax,4),%eax
c01024c2:	85 c0                	test   %eax,%eax
c01024c4:	74 1a                	je     c01024e0 <print_trapframe+0x123>
			cprintf("%s,", IA32flags[i]);
c01024c6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01024c9:	8b 04 85 00 a6 11 c0 	mov    -0x3fee5a00(,%eax,4),%eax
c01024d0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01024d4:	c7 04 24 e7 76 10 c0 	movl   $0xc01076e7,(%esp)
c01024db:	e8 d0 dc ff ff       	call   c01001b0 <cprintf>
	cprintf("  eip  0x%08x\n", tf->tf_eip);
	cprintf("  cs   0x----%04x\n", tf->tf_cs);
	cprintf("  flag 0x%08x ", tf->tf_eflags);

	int i, j;
	for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c01024e0:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01024e4:	d1 65 f0             	shll   -0x10(%ebp)
c01024e7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01024ea:	83 f8 17             	cmp    $0x17,%eax
c01024ed:	76 ba                	jbe    c01024a9 <print_trapframe+0xec>
		if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
			cprintf("%s,", IA32flags[i]);
		}
	}
	cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c01024ef:	8b 45 08             	mov    0x8(%ebp),%eax
c01024f2:	8b 40 38             	mov    0x38(%eax),%eax
c01024f5:	25 00 30 00 00       	and    $0x3000,%eax
c01024fa:	c1 e8 0c             	shr    $0xc,%eax
c01024fd:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102501:	c7 04 24 eb 76 10 c0 	movl   $0xc01076eb,(%esp)
c0102508:	e8 a3 dc ff ff       	call   c01001b0 <cprintf>

	if (!trap_in_kernel(tf)) {
c010250d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102510:	89 04 24             	mov    %eax,(%esp)
c0102513:	e8 8f fe ff ff       	call   c01023a7 <trap_in_kernel>
c0102518:	85 c0                	test   %eax,%eax
c010251a:	75 30                	jne    c010254c <print_trapframe+0x18f>
		cprintf("  esp  0x%08x\n", tf->tf_esp);
c010251c:	8b 45 08             	mov    0x8(%ebp),%eax
c010251f:	8b 40 3c             	mov    0x3c(%eax),%eax
c0102522:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102526:	c7 04 24 f4 76 10 c0 	movl   $0xc01076f4,(%esp)
c010252d:	e8 7e dc ff ff       	call   c01001b0 <cprintf>
		cprintf("  ss   0x----%04x\n", tf->tf_ss);
c0102532:	8b 45 08             	mov    0x8(%ebp),%eax
c0102535:	0f b7 40 40          	movzwl 0x40(%eax),%eax
c0102539:	0f b7 c0             	movzwl %ax,%eax
c010253c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102540:	c7 04 24 03 77 10 c0 	movl   $0xc0107703,(%esp)
c0102547:	e8 64 dc ff ff       	call   c01001b0 <cprintf>
	}
}
c010254c:	c9                   	leave  
c010254d:	c3                   	ret    

c010254e <print_regs>:

void
print_regs(struct pushregs *regs) {
c010254e:	55                   	push   %ebp
c010254f:	89 e5                	mov    %esp,%ebp
c0102551:	83 ec 18             	sub    $0x18,%esp
	cprintf("  edi  0x%08x\n", regs->reg_edi);
c0102554:	8b 45 08             	mov    0x8(%ebp),%eax
c0102557:	8b 00                	mov    (%eax),%eax
c0102559:	89 44 24 04          	mov    %eax,0x4(%esp)
c010255d:	c7 04 24 16 77 10 c0 	movl   $0xc0107716,(%esp)
c0102564:	e8 47 dc ff ff       	call   c01001b0 <cprintf>
	cprintf("  esi  0x%08x\n", regs->reg_esi);
c0102569:	8b 45 08             	mov    0x8(%ebp),%eax
c010256c:	8b 40 04             	mov    0x4(%eax),%eax
c010256f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102573:	c7 04 24 25 77 10 c0 	movl   $0xc0107725,(%esp)
c010257a:	e8 31 dc ff ff       	call   c01001b0 <cprintf>
	cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c010257f:	8b 45 08             	mov    0x8(%ebp),%eax
c0102582:	8b 40 08             	mov    0x8(%eax),%eax
c0102585:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102589:	c7 04 24 34 77 10 c0 	movl   $0xc0107734,(%esp)
c0102590:	e8 1b dc ff ff       	call   c01001b0 <cprintf>
	cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c0102595:	8b 45 08             	mov    0x8(%ebp),%eax
c0102598:	8b 40 0c             	mov    0xc(%eax),%eax
c010259b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010259f:	c7 04 24 43 77 10 c0 	movl   $0xc0107743,(%esp)
c01025a6:	e8 05 dc ff ff       	call   c01001b0 <cprintf>
	cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c01025ab:	8b 45 08             	mov    0x8(%ebp),%eax
c01025ae:	8b 40 10             	mov    0x10(%eax),%eax
c01025b1:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025b5:	c7 04 24 52 77 10 c0 	movl   $0xc0107752,(%esp)
c01025bc:	e8 ef db ff ff       	call   c01001b0 <cprintf>
	cprintf("  edx  0x%08x\n", regs->reg_edx);
c01025c1:	8b 45 08             	mov    0x8(%ebp),%eax
c01025c4:	8b 40 14             	mov    0x14(%eax),%eax
c01025c7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025cb:	c7 04 24 61 77 10 c0 	movl   $0xc0107761,(%esp)
c01025d2:	e8 d9 db ff ff       	call   c01001b0 <cprintf>
	cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c01025d7:	8b 45 08             	mov    0x8(%ebp),%eax
c01025da:	8b 40 18             	mov    0x18(%eax),%eax
c01025dd:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025e1:	c7 04 24 70 77 10 c0 	movl   $0xc0107770,(%esp)
c01025e8:	e8 c3 db ff ff       	call   c01001b0 <cprintf>
	cprintf("  eax  0x%08x\n", regs->reg_eax);
c01025ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01025f0:	8b 40 1c             	mov    0x1c(%eax),%eax
c01025f3:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025f7:	c7 04 24 7f 77 10 c0 	movl   $0xc010777f,(%esp)
c01025fe:	e8 ad db ff ff       	call   c01001b0 <cprintf>
}
c0102603:	c9                   	leave  
c0102604:	c3                   	ret    

c0102605 <trap_dispatch>:

static void
trap_dispatch(struct trapframe *tf) {
c0102605:	55                   	push   %ebp
c0102606:	89 e5                	mov    %esp,%ebp
c0102608:	83 ec 28             	sub    $0x28,%esp
	char c;

	switch (tf->tf_trapno) {
c010260b:	8b 45 08             	mov    0x8(%ebp),%eax
c010260e:	8b 40 28             	mov    0x28(%eax),%eax
c0102611:	83 f8 24             	cmp    $0x24,%eax
c0102614:	0f 87 a9 00 00 00    	ja     c01026c3 <trap_dispatch+0xbe>
c010261a:	8b 04 85 d4 77 10 c0 	mov    -0x3fef882c(,%eax,4),%eax
c0102621:	ff e0                	jmp    *%eax
	case T_DEBUG:
	case T_BRKPT:
		debug_monitor(tf);
c0102623:	8b 45 08             	mov    0x8(%ebp),%eax
c0102626:	89 04 24             	mov    %eax,(%esp)
c0102629:	e8 dc e7 ff ff       	call   c0100e0a <debug_monitor>
		break;
c010262e:	e9 c9 00 00 00       	jmp    c01026fc <trap_dispatch+0xf7>
	case IRQ_OFFSET + IRQ_TIMER:
		/* LAB1 2008010486 */
		++ticks;
c0102633:	a1 8c ba 11 c0       	mov    0xc011ba8c,%eax
c0102638:	83 c0 01             	add    $0x1,%eax
c010263b:	a3 8c ba 11 c0       	mov    %eax,0xc011ba8c
		if (ticks % 100 == 0) {
c0102640:	8b 0d 8c ba 11 c0    	mov    0xc011ba8c,%ecx
c0102646:	ba 1f 85 eb 51       	mov    $0x51eb851f,%edx
c010264b:	89 c8                	mov    %ecx,%eax
c010264d:	f7 e2                	mul    %edx
c010264f:	89 d0                	mov    %edx,%eax
c0102651:	c1 e8 05             	shr    $0x5,%eax
c0102654:	6b c0 64             	imul   $0x64,%eax,%eax
c0102657:	89 ca                	mov    %ecx,%edx
c0102659:	29 c2                	sub    %eax,%edx
c010265b:	89 d0                	mov    %edx,%eax
c010265d:	85 c0                	test   %eax,%eax
c010265f:	0f 85 96 00 00 00    	jne    c01026fb <trap_dispatch+0xf6>
			print_ticks();
c0102665:	e8 fe fb ff ff       	call   c0102268 <print_ticks>
		}
		break;
c010266a:	e9 8d 00 00 00       	jmp    c01026fc <trap_dispatch+0xf7>
	case IRQ_OFFSET + IRQ_COM1:
	case IRQ_OFFSET + IRQ_KBD:
		if ((c = cons_getc()) == 13) {
c010266f:	e8 af f9 ff ff       	call   c0102023 <cons_getc>
c0102674:	88 45 f7             	mov    %al,-0x9(%ebp)
c0102677:	80 7d f7 0d          	cmpb   $0xd,-0x9(%ebp)
c010267b:	75 0d                	jne    c010268a <trap_dispatch+0x85>
			debug_monitor(tf);
c010267d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102680:	89 04 24             	mov    %eax,(%esp)
c0102683:	e8 82 e7 ff ff       	call   c0100e0a <debug_monitor>
		}
		else {
			cprintf("%s [%03d] %c\n",
					(tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
		}
		break;
c0102688:	eb 72                	jmp    c01026fc <trap_dispatch+0xf7>
	case IRQ_OFFSET + IRQ_KBD:
		if ((c = cons_getc()) == 13) {
			debug_monitor(tf);
		}
		else {
			cprintf("%s [%03d] %c\n",
c010268a:	0f be 4d f7          	movsbl -0x9(%ebp),%ecx
c010268e:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
					(tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
c0102692:	8b 45 08             	mov    0x8(%ebp),%eax
c0102695:	8b 40 28             	mov    0x28(%eax),%eax
	case IRQ_OFFSET + IRQ_KBD:
		if ((c = cons_getc()) == 13) {
			debug_monitor(tf);
		}
		else {
			cprintf("%s [%03d] %c\n",
c0102698:	83 f8 21             	cmp    $0x21,%eax
c010269b:	74 07                	je     c01026a4 <trap_dispatch+0x9f>
c010269d:	b8 8e 77 10 c0       	mov    $0xc010778e,%eax
c01026a2:	eb 05                	jmp    c01026a9 <trap_dispatch+0xa4>
c01026a4:	b8 95 77 10 c0       	mov    $0xc0107795,%eax
c01026a9:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01026ad:	89 54 24 08          	mov    %edx,0x8(%esp)
c01026b1:	89 44 24 04          	mov    %eax,0x4(%esp)
c01026b5:	c7 04 24 99 77 10 c0 	movl   $0xc0107799,(%esp)
c01026bc:	e8 ef da ff ff       	call   c01001b0 <cprintf>
					(tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
		}
		break;
c01026c1:	eb 39                	jmp    c01026fc <trap_dispatch+0xf7>
	default:
		// in kernel, it must be a mistake
		if ((tf->tf_cs & 3) == 0) {
c01026c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01026c6:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c01026ca:	0f b7 c0             	movzwl %ax,%eax
c01026cd:	83 e0 03             	and    $0x3,%eax
c01026d0:	85 c0                	test   %eax,%eax
c01026d2:	75 28                	jne    c01026fc <trap_dispatch+0xf7>
			print_trapframe(tf);
c01026d4:	8b 45 08             	mov    0x8(%ebp),%eax
c01026d7:	89 04 24             	mov    %eax,(%esp)
c01026da:	e8 de fc ff ff       	call   c01023bd <print_trapframe>
			panic("unexpected trap in kernel.\n");
c01026df:	c7 44 24 08 a7 77 10 	movl   $0xc01077a7,0x8(%esp)
c01026e6:	c0 
c01026e7:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
c01026ee:	00 
c01026ef:	c7 04 24 c3 77 10 c0 	movl   $0xc01077c3,(%esp)
c01026f6:	e8 09 ef ff ff       	call   c0101604 <__panic>
		/* LAB1 2008010486 */
		++ticks;
		if (ticks % 100 == 0) {
			print_ticks();
		}
		break;
c01026fb:	90                   	nop
		if ((tf->tf_cs & 3) == 0) {
			print_trapframe(tf);
			panic("unexpected trap in kernel.\n");
		}
	}
}
c01026fc:	c9                   	leave  
c01026fd:	c3                   	ret    

c01026fe <trap>:

void
trap(struct trapframe *tf) {
c01026fe:	55                   	push   %ebp
c01026ff:	89 e5                	mov    %esp,%ebp
c0102701:	83 ec 18             	sub    $0x18,%esp
	// dispatch based on what type of trap occurred
	trap_dispatch(tf);
c0102704:	8b 45 08             	mov    0x8(%ebp),%eax
c0102707:	89 04 24             	mov    %eax,(%esp)
c010270a:	e8 f6 fe ff ff       	call   c0102605 <trap_dispatch>
}
c010270f:	c9                   	leave  
c0102710:	c3                   	ret    
c0102711:	00 00                	add    %al,(%eax)
	...

c0102714 <__alltraps>:
.text
.globl __alltraps
__alltraps:
	# push registers to build a trap frame
	# therefore make the stack look like a struct trapframe
	pushl %ds
c0102714:	1e                   	push   %ds
	pushl %es
c0102715:	06                   	push   %es
	pushal
c0102716:	60                   	pusha  

	# load GD_KDATA into %ds and %es to set up data segments for kernel
	movl $GD_KDATA, %eax
c0102717:	b8 10 00 00 00       	mov    $0x10,%eax
	movw %ax, %ds
c010271c:	8e d8                	mov    %eax,%ds
	movw %ax, %es
c010271e:	8e c0                	mov    %eax,%es

	# push %esp to pass a pointer to the trapframe as an argument to trap()
	pushl %esp
c0102720:	54                   	push   %esp

	# call trap(tf), where tf=%esp
	call trap
c0102721:	e8 d8 ff ff ff       	call   c01026fe <trap>

	# pop the pushed stack pointer
	popl %esp
c0102726:	5c                   	pop    %esp

c0102727 <__trapret>:

	# return falls through to trapret...
.globl __trapret
__trapret:
	# restore registers from stack
	popal
c0102727:	61                   	popa   

	# restore %ds and %es
	popl %es
c0102728:	07                   	pop    %es
	popl %ds
c0102729:	1f                   	pop    %ds

	# get rid of the trap number and error code
	addl $0x8, %esp
c010272a:	83 c4 08             	add    $0x8,%esp
	iret
c010272d:	cf                   	iret   
	...

c0102730 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c0102730:	6a 00                	push   $0x0
  pushl $0
c0102732:	6a 00                	push   $0x0
  jmp __alltraps
c0102734:	e9 db ff ff ff       	jmp    c0102714 <__alltraps>

c0102739 <vector1>:
.globl vector1
vector1:
  pushl $0
c0102739:	6a 00                	push   $0x0
  pushl $1
c010273b:	6a 01                	push   $0x1
  jmp __alltraps
c010273d:	e9 d2 ff ff ff       	jmp    c0102714 <__alltraps>

c0102742 <vector2>:
.globl vector2
vector2:
  pushl $0
c0102742:	6a 00                	push   $0x0
  pushl $2
c0102744:	6a 02                	push   $0x2
  jmp __alltraps
c0102746:	e9 c9 ff ff ff       	jmp    c0102714 <__alltraps>

c010274b <vector3>:
.globl vector3
vector3:
  pushl $0
c010274b:	6a 00                	push   $0x0
  pushl $3
c010274d:	6a 03                	push   $0x3
  jmp __alltraps
c010274f:	e9 c0 ff ff ff       	jmp    c0102714 <__alltraps>

c0102754 <vector4>:
.globl vector4
vector4:
  pushl $0
c0102754:	6a 00                	push   $0x0
  pushl $4
c0102756:	6a 04                	push   $0x4
  jmp __alltraps
c0102758:	e9 b7 ff ff ff       	jmp    c0102714 <__alltraps>

c010275d <vector5>:
.globl vector5
vector5:
  pushl $0
c010275d:	6a 00                	push   $0x0
  pushl $5
c010275f:	6a 05                	push   $0x5
  jmp __alltraps
c0102761:	e9 ae ff ff ff       	jmp    c0102714 <__alltraps>

c0102766 <vector6>:
.globl vector6
vector6:
  pushl $0
c0102766:	6a 00                	push   $0x0
  pushl $6
c0102768:	6a 06                	push   $0x6
  jmp __alltraps
c010276a:	e9 a5 ff ff ff       	jmp    c0102714 <__alltraps>

c010276f <vector7>:
.globl vector7
vector7:
  pushl $0
c010276f:	6a 00                	push   $0x0
  pushl $7
c0102771:	6a 07                	push   $0x7
  jmp __alltraps
c0102773:	e9 9c ff ff ff       	jmp    c0102714 <__alltraps>

c0102778 <vector8>:
.globl vector8
vector8:
  pushl $8
c0102778:	6a 08                	push   $0x8
  jmp __alltraps
c010277a:	e9 95 ff ff ff       	jmp    c0102714 <__alltraps>

c010277f <vector9>:
.globl vector9
vector9:
  pushl $9
c010277f:	6a 09                	push   $0x9
  jmp __alltraps
c0102781:	e9 8e ff ff ff       	jmp    c0102714 <__alltraps>

c0102786 <vector10>:
.globl vector10
vector10:
  pushl $10
c0102786:	6a 0a                	push   $0xa
  jmp __alltraps
c0102788:	e9 87 ff ff ff       	jmp    c0102714 <__alltraps>

c010278d <vector11>:
.globl vector11
vector11:
  pushl $11
c010278d:	6a 0b                	push   $0xb
  jmp __alltraps
c010278f:	e9 80 ff ff ff       	jmp    c0102714 <__alltraps>

c0102794 <vector12>:
.globl vector12
vector12:
  pushl $12
c0102794:	6a 0c                	push   $0xc
  jmp __alltraps
c0102796:	e9 79 ff ff ff       	jmp    c0102714 <__alltraps>

c010279b <vector13>:
.globl vector13
vector13:
  pushl $13
c010279b:	6a 0d                	push   $0xd
  jmp __alltraps
c010279d:	e9 72 ff ff ff       	jmp    c0102714 <__alltraps>

c01027a2 <vector14>:
.globl vector14
vector14:
  pushl $14
c01027a2:	6a 0e                	push   $0xe
  jmp __alltraps
c01027a4:	e9 6b ff ff ff       	jmp    c0102714 <__alltraps>

c01027a9 <vector15>:
.globl vector15
vector15:
  pushl $0
c01027a9:	6a 00                	push   $0x0
  pushl $15
c01027ab:	6a 0f                	push   $0xf
  jmp __alltraps
c01027ad:	e9 62 ff ff ff       	jmp    c0102714 <__alltraps>

c01027b2 <vector16>:
.globl vector16
vector16:
  pushl $0
c01027b2:	6a 00                	push   $0x0
  pushl $16
c01027b4:	6a 10                	push   $0x10
  jmp __alltraps
c01027b6:	e9 59 ff ff ff       	jmp    c0102714 <__alltraps>

c01027bb <vector17>:
.globl vector17
vector17:
  pushl $17
c01027bb:	6a 11                	push   $0x11
  jmp __alltraps
c01027bd:	e9 52 ff ff ff       	jmp    c0102714 <__alltraps>

c01027c2 <vector18>:
.globl vector18
vector18:
  pushl $0
c01027c2:	6a 00                	push   $0x0
  pushl $18
c01027c4:	6a 12                	push   $0x12
  jmp __alltraps
c01027c6:	e9 49 ff ff ff       	jmp    c0102714 <__alltraps>

c01027cb <vector19>:
.globl vector19
vector19:
  pushl $0
c01027cb:	6a 00                	push   $0x0
  pushl $19
c01027cd:	6a 13                	push   $0x13
  jmp __alltraps
c01027cf:	e9 40 ff ff ff       	jmp    c0102714 <__alltraps>

c01027d4 <vector20>:
.globl vector20
vector20:
  pushl $0
c01027d4:	6a 00                	push   $0x0
  pushl $20
c01027d6:	6a 14                	push   $0x14
  jmp __alltraps
c01027d8:	e9 37 ff ff ff       	jmp    c0102714 <__alltraps>

c01027dd <vector21>:
.globl vector21
vector21:
  pushl $0
c01027dd:	6a 00                	push   $0x0
  pushl $21
c01027df:	6a 15                	push   $0x15
  jmp __alltraps
c01027e1:	e9 2e ff ff ff       	jmp    c0102714 <__alltraps>

c01027e6 <vector22>:
.globl vector22
vector22:
  pushl $0
c01027e6:	6a 00                	push   $0x0
  pushl $22
c01027e8:	6a 16                	push   $0x16
  jmp __alltraps
c01027ea:	e9 25 ff ff ff       	jmp    c0102714 <__alltraps>

c01027ef <vector23>:
.globl vector23
vector23:
  pushl $0
c01027ef:	6a 00                	push   $0x0
  pushl $23
c01027f1:	6a 17                	push   $0x17
  jmp __alltraps
c01027f3:	e9 1c ff ff ff       	jmp    c0102714 <__alltraps>

c01027f8 <vector24>:
.globl vector24
vector24:
  pushl $0
c01027f8:	6a 00                	push   $0x0
  pushl $24
c01027fa:	6a 18                	push   $0x18
  jmp __alltraps
c01027fc:	e9 13 ff ff ff       	jmp    c0102714 <__alltraps>

c0102801 <vector25>:
.globl vector25
vector25:
  pushl $0
c0102801:	6a 00                	push   $0x0
  pushl $25
c0102803:	6a 19                	push   $0x19
  jmp __alltraps
c0102805:	e9 0a ff ff ff       	jmp    c0102714 <__alltraps>

c010280a <vector26>:
.globl vector26
vector26:
  pushl $0
c010280a:	6a 00                	push   $0x0
  pushl $26
c010280c:	6a 1a                	push   $0x1a
  jmp __alltraps
c010280e:	e9 01 ff ff ff       	jmp    c0102714 <__alltraps>

c0102813 <vector27>:
.globl vector27
vector27:
  pushl $0
c0102813:	6a 00                	push   $0x0
  pushl $27
c0102815:	6a 1b                	push   $0x1b
  jmp __alltraps
c0102817:	e9 f8 fe ff ff       	jmp    c0102714 <__alltraps>

c010281c <vector28>:
.globl vector28
vector28:
  pushl $0
c010281c:	6a 00                	push   $0x0
  pushl $28
c010281e:	6a 1c                	push   $0x1c
  jmp __alltraps
c0102820:	e9 ef fe ff ff       	jmp    c0102714 <__alltraps>

c0102825 <vector29>:
.globl vector29
vector29:
  pushl $0
c0102825:	6a 00                	push   $0x0
  pushl $29
c0102827:	6a 1d                	push   $0x1d
  jmp __alltraps
c0102829:	e9 e6 fe ff ff       	jmp    c0102714 <__alltraps>

c010282e <vector30>:
.globl vector30
vector30:
  pushl $0
c010282e:	6a 00                	push   $0x0
  pushl $30
c0102830:	6a 1e                	push   $0x1e
  jmp __alltraps
c0102832:	e9 dd fe ff ff       	jmp    c0102714 <__alltraps>

c0102837 <vector31>:
.globl vector31
vector31:
  pushl $0
c0102837:	6a 00                	push   $0x0
  pushl $31
c0102839:	6a 1f                	push   $0x1f
  jmp __alltraps
c010283b:	e9 d4 fe ff ff       	jmp    c0102714 <__alltraps>

c0102840 <vector32>:
.globl vector32
vector32:
  pushl $0
c0102840:	6a 00                	push   $0x0
  pushl $32
c0102842:	6a 20                	push   $0x20
  jmp __alltraps
c0102844:	e9 cb fe ff ff       	jmp    c0102714 <__alltraps>

c0102849 <vector33>:
.globl vector33
vector33:
  pushl $0
c0102849:	6a 00                	push   $0x0
  pushl $33
c010284b:	6a 21                	push   $0x21
  jmp __alltraps
c010284d:	e9 c2 fe ff ff       	jmp    c0102714 <__alltraps>

c0102852 <vector34>:
.globl vector34
vector34:
  pushl $0
c0102852:	6a 00                	push   $0x0
  pushl $34
c0102854:	6a 22                	push   $0x22
  jmp __alltraps
c0102856:	e9 b9 fe ff ff       	jmp    c0102714 <__alltraps>

c010285b <vector35>:
.globl vector35
vector35:
  pushl $0
c010285b:	6a 00                	push   $0x0
  pushl $35
c010285d:	6a 23                	push   $0x23
  jmp __alltraps
c010285f:	e9 b0 fe ff ff       	jmp    c0102714 <__alltraps>

c0102864 <vector36>:
.globl vector36
vector36:
  pushl $0
c0102864:	6a 00                	push   $0x0
  pushl $36
c0102866:	6a 24                	push   $0x24
  jmp __alltraps
c0102868:	e9 a7 fe ff ff       	jmp    c0102714 <__alltraps>

c010286d <vector37>:
.globl vector37
vector37:
  pushl $0
c010286d:	6a 00                	push   $0x0
  pushl $37
c010286f:	6a 25                	push   $0x25
  jmp __alltraps
c0102871:	e9 9e fe ff ff       	jmp    c0102714 <__alltraps>

c0102876 <vector38>:
.globl vector38
vector38:
  pushl $0
c0102876:	6a 00                	push   $0x0
  pushl $38
c0102878:	6a 26                	push   $0x26
  jmp __alltraps
c010287a:	e9 95 fe ff ff       	jmp    c0102714 <__alltraps>

c010287f <vector39>:
.globl vector39
vector39:
  pushl $0
c010287f:	6a 00                	push   $0x0
  pushl $39
c0102881:	6a 27                	push   $0x27
  jmp __alltraps
c0102883:	e9 8c fe ff ff       	jmp    c0102714 <__alltraps>

c0102888 <vector40>:
.globl vector40
vector40:
  pushl $0
c0102888:	6a 00                	push   $0x0
  pushl $40
c010288a:	6a 28                	push   $0x28
  jmp __alltraps
c010288c:	e9 83 fe ff ff       	jmp    c0102714 <__alltraps>

c0102891 <vector41>:
.globl vector41
vector41:
  pushl $0
c0102891:	6a 00                	push   $0x0
  pushl $41
c0102893:	6a 29                	push   $0x29
  jmp __alltraps
c0102895:	e9 7a fe ff ff       	jmp    c0102714 <__alltraps>

c010289a <vector42>:
.globl vector42
vector42:
  pushl $0
c010289a:	6a 00                	push   $0x0
  pushl $42
c010289c:	6a 2a                	push   $0x2a
  jmp __alltraps
c010289e:	e9 71 fe ff ff       	jmp    c0102714 <__alltraps>

c01028a3 <vector43>:
.globl vector43
vector43:
  pushl $0
c01028a3:	6a 00                	push   $0x0
  pushl $43
c01028a5:	6a 2b                	push   $0x2b
  jmp __alltraps
c01028a7:	e9 68 fe ff ff       	jmp    c0102714 <__alltraps>

c01028ac <vector44>:
.globl vector44
vector44:
  pushl $0
c01028ac:	6a 00                	push   $0x0
  pushl $44
c01028ae:	6a 2c                	push   $0x2c
  jmp __alltraps
c01028b0:	e9 5f fe ff ff       	jmp    c0102714 <__alltraps>

c01028b5 <vector45>:
.globl vector45
vector45:
  pushl $0
c01028b5:	6a 00                	push   $0x0
  pushl $45
c01028b7:	6a 2d                	push   $0x2d
  jmp __alltraps
c01028b9:	e9 56 fe ff ff       	jmp    c0102714 <__alltraps>

c01028be <vector46>:
.globl vector46
vector46:
  pushl $0
c01028be:	6a 00                	push   $0x0
  pushl $46
c01028c0:	6a 2e                	push   $0x2e
  jmp __alltraps
c01028c2:	e9 4d fe ff ff       	jmp    c0102714 <__alltraps>

c01028c7 <vector47>:
.globl vector47
vector47:
  pushl $0
c01028c7:	6a 00                	push   $0x0
  pushl $47
c01028c9:	6a 2f                	push   $0x2f
  jmp __alltraps
c01028cb:	e9 44 fe ff ff       	jmp    c0102714 <__alltraps>

c01028d0 <vector48>:
.globl vector48
vector48:
  pushl $0
c01028d0:	6a 00                	push   $0x0
  pushl $48
c01028d2:	6a 30                	push   $0x30
  jmp __alltraps
c01028d4:	e9 3b fe ff ff       	jmp    c0102714 <__alltraps>

c01028d9 <vector49>:
.globl vector49
vector49:
  pushl $0
c01028d9:	6a 00                	push   $0x0
  pushl $49
c01028db:	6a 31                	push   $0x31
  jmp __alltraps
c01028dd:	e9 32 fe ff ff       	jmp    c0102714 <__alltraps>

c01028e2 <vector50>:
.globl vector50
vector50:
  pushl $0
c01028e2:	6a 00                	push   $0x0
  pushl $50
c01028e4:	6a 32                	push   $0x32
  jmp __alltraps
c01028e6:	e9 29 fe ff ff       	jmp    c0102714 <__alltraps>

c01028eb <vector51>:
.globl vector51
vector51:
  pushl $0
c01028eb:	6a 00                	push   $0x0
  pushl $51
c01028ed:	6a 33                	push   $0x33
  jmp __alltraps
c01028ef:	e9 20 fe ff ff       	jmp    c0102714 <__alltraps>

c01028f4 <vector52>:
.globl vector52
vector52:
  pushl $0
c01028f4:	6a 00                	push   $0x0
  pushl $52
c01028f6:	6a 34                	push   $0x34
  jmp __alltraps
c01028f8:	e9 17 fe ff ff       	jmp    c0102714 <__alltraps>

c01028fd <vector53>:
.globl vector53
vector53:
  pushl $0
c01028fd:	6a 00                	push   $0x0
  pushl $53
c01028ff:	6a 35                	push   $0x35
  jmp __alltraps
c0102901:	e9 0e fe ff ff       	jmp    c0102714 <__alltraps>

c0102906 <vector54>:
.globl vector54
vector54:
  pushl $0
c0102906:	6a 00                	push   $0x0
  pushl $54
c0102908:	6a 36                	push   $0x36
  jmp __alltraps
c010290a:	e9 05 fe ff ff       	jmp    c0102714 <__alltraps>

c010290f <vector55>:
.globl vector55
vector55:
  pushl $0
c010290f:	6a 00                	push   $0x0
  pushl $55
c0102911:	6a 37                	push   $0x37
  jmp __alltraps
c0102913:	e9 fc fd ff ff       	jmp    c0102714 <__alltraps>

c0102918 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102918:	6a 00                	push   $0x0
  pushl $56
c010291a:	6a 38                	push   $0x38
  jmp __alltraps
c010291c:	e9 f3 fd ff ff       	jmp    c0102714 <__alltraps>

c0102921 <vector57>:
.globl vector57
vector57:
  pushl $0
c0102921:	6a 00                	push   $0x0
  pushl $57
c0102923:	6a 39                	push   $0x39
  jmp __alltraps
c0102925:	e9 ea fd ff ff       	jmp    c0102714 <__alltraps>

c010292a <vector58>:
.globl vector58
vector58:
  pushl $0
c010292a:	6a 00                	push   $0x0
  pushl $58
c010292c:	6a 3a                	push   $0x3a
  jmp __alltraps
c010292e:	e9 e1 fd ff ff       	jmp    c0102714 <__alltraps>

c0102933 <vector59>:
.globl vector59
vector59:
  pushl $0
c0102933:	6a 00                	push   $0x0
  pushl $59
c0102935:	6a 3b                	push   $0x3b
  jmp __alltraps
c0102937:	e9 d8 fd ff ff       	jmp    c0102714 <__alltraps>

c010293c <vector60>:
.globl vector60
vector60:
  pushl $0
c010293c:	6a 00                	push   $0x0
  pushl $60
c010293e:	6a 3c                	push   $0x3c
  jmp __alltraps
c0102940:	e9 cf fd ff ff       	jmp    c0102714 <__alltraps>

c0102945 <vector61>:
.globl vector61
vector61:
  pushl $0
c0102945:	6a 00                	push   $0x0
  pushl $61
c0102947:	6a 3d                	push   $0x3d
  jmp __alltraps
c0102949:	e9 c6 fd ff ff       	jmp    c0102714 <__alltraps>

c010294e <vector62>:
.globl vector62
vector62:
  pushl $0
c010294e:	6a 00                	push   $0x0
  pushl $62
c0102950:	6a 3e                	push   $0x3e
  jmp __alltraps
c0102952:	e9 bd fd ff ff       	jmp    c0102714 <__alltraps>

c0102957 <vector63>:
.globl vector63
vector63:
  pushl $0
c0102957:	6a 00                	push   $0x0
  pushl $63
c0102959:	6a 3f                	push   $0x3f
  jmp __alltraps
c010295b:	e9 b4 fd ff ff       	jmp    c0102714 <__alltraps>

c0102960 <vector64>:
.globl vector64
vector64:
  pushl $0
c0102960:	6a 00                	push   $0x0
  pushl $64
c0102962:	6a 40                	push   $0x40
  jmp __alltraps
c0102964:	e9 ab fd ff ff       	jmp    c0102714 <__alltraps>

c0102969 <vector65>:
.globl vector65
vector65:
  pushl $0
c0102969:	6a 00                	push   $0x0
  pushl $65
c010296b:	6a 41                	push   $0x41
  jmp __alltraps
c010296d:	e9 a2 fd ff ff       	jmp    c0102714 <__alltraps>

c0102972 <vector66>:
.globl vector66
vector66:
  pushl $0
c0102972:	6a 00                	push   $0x0
  pushl $66
c0102974:	6a 42                	push   $0x42
  jmp __alltraps
c0102976:	e9 99 fd ff ff       	jmp    c0102714 <__alltraps>

c010297b <vector67>:
.globl vector67
vector67:
  pushl $0
c010297b:	6a 00                	push   $0x0
  pushl $67
c010297d:	6a 43                	push   $0x43
  jmp __alltraps
c010297f:	e9 90 fd ff ff       	jmp    c0102714 <__alltraps>

c0102984 <vector68>:
.globl vector68
vector68:
  pushl $0
c0102984:	6a 00                	push   $0x0
  pushl $68
c0102986:	6a 44                	push   $0x44
  jmp __alltraps
c0102988:	e9 87 fd ff ff       	jmp    c0102714 <__alltraps>

c010298d <vector69>:
.globl vector69
vector69:
  pushl $0
c010298d:	6a 00                	push   $0x0
  pushl $69
c010298f:	6a 45                	push   $0x45
  jmp __alltraps
c0102991:	e9 7e fd ff ff       	jmp    c0102714 <__alltraps>

c0102996 <vector70>:
.globl vector70
vector70:
  pushl $0
c0102996:	6a 00                	push   $0x0
  pushl $70
c0102998:	6a 46                	push   $0x46
  jmp __alltraps
c010299a:	e9 75 fd ff ff       	jmp    c0102714 <__alltraps>

c010299f <vector71>:
.globl vector71
vector71:
  pushl $0
c010299f:	6a 00                	push   $0x0
  pushl $71
c01029a1:	6a 47                	push   $0x47
  jmp __alltraps
c01029a3:	e9 6c fd ff ff       	jmp    c0102714 <__alltraps>

c01029a8 <vector72>:
.globl vector72
vector72:
  pushl $0
c01029a8:	6a 00                	push   $0x0
  pushl $72
c01029aa:	6a 48                	push   $0x48
  jmp __alltraps
c01029ac:	e9 63 fd ff ff       	jmp    c0102714 <__alltraps>

c01029b1 <vector73>:
.globl vector73
vector73:
  pushl $0
c01029b1:	6a 00                	push   $0x0
  pushl $73
c01029b3:	6a 49                	push   $0x49
  jmp __alltraps
c01029b5:	e9 5a fd ff ff       	jmp    c0102714 <__alltraps>

c01029ba <vector74>:
.globl vector74
vector74:
  pushl $0
c01029ba:	6a 00                	push   $0x0
  pushl $74
c01029bc:	6a 4a                	push   $0x4a
  jmp __alltraps
c01029be:	e9 51 fd ff ff       	jmp    c0102714 <__alltraps>

c01029c3 <vector75>:
.globl vector75
vector75:
  pushl $0
c01029c3:	6a 00                	push   $0x0
  pushl $75
c01029c5:	6a 4b                	push   $0x4b
  jmp __alltraps
c01029c7:	e9 48 fd ff ff       	jmp    c0102714 <__alltraps>

c01029cc <vector76>:
.globl vector76
vector76:
  pushl $0
c01029cc:	6a 00                	push   $0x0
  pushl $76
c01029ce:	6a 4c                	push   $0x4c
  jmp __alltraps
c01029d0:	e9 3f fd ff ff       	jmp    c0102714 <__alltraps>

c01029d5 <vector77>:
.globl vector77
vector77:
  pushl $0
c01029d5:	6a 00                	push   $0x0
  pushl $77
c01029d7:	6a 4d                	push   $0x4d
  jmp __alltraps
c01029d9:	e9 36 fd ff ff       	jmp    c0102714 <__alltraps>

c01029de <vector78>:
.globl vector78
vector78:
  pushl $0
c01029de:	6a 00                	push   $0x0
  pushl $78
c01029e0:	6a 4e                	push   $0x4e
  jmp __alltraps
c01029e2:	e9 2d fd ff ff       	jmp    c0102714 <__alltraps>

c01029e7 <vector79>:
.globl vector79
vector79:
  pushl $0
c01029e7:	6a 00                	push   $0x0
  pushl $79
c01029e9:	6a 4f                	push   $0x4f
  jmp __alltraps
c01029eb:	e9 24 fd ff ff       	jmp    c0102714 <__alltraps>

c01029f0 <vector80>:
.globl vector80
vector80:
  pushl $0
c01029f0:	6a 00                	push   $0x0
  pushl $80
c01029f2:	6a 50                	push   $0x50
  jmp __alltraps
c01029f4:	e9 1b fd ff ff       	jmp    c0102714 <__alltraps>

c01029f9 <vector81>:
.globl vector81
vector81:
  pushl $0
c01029f9:	6a 00                	push   $0x0
  pushl $81
c01029fb:	6a 51                	push   $0x51
  jmp __alltraps
c01029fd:	e9 12 fd ff ff       	jmp    c0102714 <__alltraps>

c0102a02 <vector82>:
.globl vector82
vector82:
  pushl $0
c0102a02:	6a 00                	push   $0x0
  pushl $82
c0102a04:	6a 52                	push   $0x52
  jmp __alltraps
c0102a06:	e9 09 fd ff ff       	jmp    c0102714 <__alltraps>

c0102a0b <vector83>:
.globl vector83
vector83:
  pushl $0
c0102a0b:	6a 00                	push   $0x0
  pushl $83
c0102a0d:	6a 53                	push   $0x53
  jmp __alltraps
c0102a0f:	e9 00 fd ff ff       	jmp    c0102714 <__alltraps>

c0102a14 <vector84>:
.globl vector84
vector84:
  pushl $0
c0102a14:	6a 00                	push   $0x0
  pushl $84
c0102a16:	6a 54                	push   $0x54
  jmp __alltraps
c0102a18:	e9 f7 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a1d <vector85>:
.globl vector85
vector85:
  pushl $0
c0102a1d:	6a 00                	push   $0x0
  pushl $85
c0102a1f:	6a 55                	push   $0x55
  jmp __alltraps
c0102a21:	e9 ee fc ff ff       	jmp    c0102714 <__alltraps>

c0102a26 <vector86>:
.globl vector86
vector86:
  pushl $0
c0102a26:	6a 00                	push   $0x0
  pushl $86
c0102a28:	6a 56                	push   $0x56
  jmp __alltraps
c0102a2a:	e9 e5 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a2f <vector87>:
.globl vector87
vector87:
  pushl $0
c0102a2f:	6a 00                	push   $0x0
  pushl $87
c0102a31:	6a 57                	push   $0x57
  jmp __alltraps
c0102a33:	e9 dc fc ff ff       	jmp    c0102714 <__alltraps>

c0102a38 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102a38:	6a 00                	push   $0x0
  pushl $88
c0102a3a:	6a 58                	push   $0x58
  jmp __alltraps
c0102a3c:	e9 d3 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a41 <vector89>:
.globl vector89
vector89:
  pushl $0
c0102a41:	6a 00                	push   $0x0
  pushl $89
c0102a43:	6a 59                	push   $0x59
  jmp __alltraps
c0102a45:	e9 ca fc ff ff       	jmp    c0102714 <__alltraps>

c0102a4a <vector90>:
.globl vector90
vector90:
  pushl $0
c0102a4a:	6a 00                	push   $0x0
  pushl $90
c0102a4c:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102a4e:	e9 c1 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a53 <vector91>:
.globl vector91
vector91:
  pushl $0
c0102a53:	6a 00                	push   $0x0
  pushl $91
c0102a55:	6a 5b                	push   $0x5b
  jmp __alltraps
c0102a57:	e9 b8 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a5c <vector92>:
.globl vector92
vector92:
  pushl $0
c0102a5c:	6a 00                	push   $0x0
  pushl $92
c0102a5e:	6a 5c                	push   $0x5c
  jmp __alltraps
c0102a60:	e9 af fc ff ff       	jmp    c0102714 <__alltraps>

c0102a65 <vector93>:
.globl vector93
vector93:
  pushl $0
c0102a65:	6a 00                	push   $0x0
  pushl $93
c0102a67:	6a 5d                	push   $0x5d
  jmp __alltraps
c0102a69:	e9 a6 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a6e <vector94>:
.globl vector94
vector94:
  pushl $0
c0102a6e:	6a 00                	push   $0x0
  pushl $94
c0102a70:	6a 5e                	push   $0x5e
  jmp __alltraps
c0102a72:	e9 9d fc ff ff       	jmp    c0102714 <__alltraps>

c0102a77 <vector95>:
.globl vector95
vector95:
  pushl $0
c0102a77:	6a 00                	push   $0x0
  pushl $95
c0102a79:	6a 5f                	push   $0x5f
  jmp __alltraps
c0102a7b:	e9 94 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a80 <vector96>:
.globl vector96
vector96:
  pushl $0
c0102a80:	6a 00                	push   $0x0
  pushl $96
c0102a82:	6a 60                	push   $0x60
  jmp __alltraps
c0102a84:	e9 8b fc ff ff       	jmp    c0102714 <__alltraps>

c0102a89 <vector97>:
.globl vector97
vector97:
  pushl $0
c0102a89:	6a 00                	push   $0x0
  pushl $97
c0102a8b:	6a 61                	push   $0x61
  jmp __alltraps
c0102a8d:	e9 82 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a92 <vector98>:
.globl vector98
vector98:
  pushl $0
c0102a92:	6a 00                	push   $0x0
  pushl $98
c0102a94:	6a 62                	push   $0x62
  jmp __alltraps
c0102a96:	e9 79 fc ff ff       	jmp    c0102714 <__alltraps>

c0102a9b <vector99>:
.globl vector99
vector99:
  pushl $0
c0102a9b:	6a 00                	push   $0x0
  pushl $99
c0102a9d:	6a 63                	push   $0x63
  jmp __alltraps
c0102a9f:	e9 70 fc ff ff       	jmp    c0102714 <__alltraps>

c0102aa4 <vector100>:
.globl vector100
vector100:
  pushl $0
c0102aa4:	6a 00                	push   $0x0
  pushl $100
c0102aa6:	6a 64                	push   $0x64
  jmp __alltraps
c0102aa8:	e9 67 fc ff ff       	jmp    c0102714 <__alltraps>

c0102aad <vector101>:
.globl vector101
vector101:
  pushl $0
c0102aad:	6a 00                	push   $0x0
  pushl $101
c0102aaf:	6a 65                	push   $0x65
  jmp __alltraps
c0102ab1:	e9 5e fc ff ff       	jmp    c0102714 <__alltraps>

c0102ab6 <vector102>:
.globl vector102
vector102:
  pushl $0
c0102ab6:	6a 00                	push   $0x0
  pushl $102
c0102ab8:	6a 66                	push   $0x66
  jmp __alltraps
c0102aba:	e9 55 fc ff ff       	jmp    c0102714 <__alltraps>

c0102abf <vector103>:
.globl vector103
vector103:
  pushl $0
c0102abf:	6a 00                	push   $0x0
  pushl $103
c0102ac1:	6a 67                	push   $0x67
  jmp __alltraps
c0102ac3:	e9 4c fc ff ff       	jmp    c0102714 <__alltraps>

c0102ac8 <vector104>:
.globl vector104
vector104:
  pushl $0
c0102ac8:	6a 00                	push   $0x0
  pushl $104
c0102aca:	6a 68                	push   $0x68
  jmp __alltraps
c0102acc:	e9 43 fc ff ff       	jmp    c0102714 <__alltraps>

c0102ad1 <vector105>:
.globl vector105
vector105:
  pushl $0
c0102ad1:	6a 00                	push   $0x0
  pushl $105
c0102ad3:	6a 69                	push   $0x69
  jmp __alltraps
c0102ad5:	e9 3a fc ff ff       	jmp    c0102714 <__alltraps>

c0102ada <vector106>:
.globl vector106
vector106:
  pushl $0
c0102ada:	6a 00                	push   $0x0
  pushl $106
c0102adc:	6a 6a                	push   $0x6a
  jmp __alltraps
c0102ade:	e9 31 fc ff ff       	jmp    c0102714 <__alltraps>

c0102ae3 <vector107>:
.globl vector107
vector107:
  pushl $0
c0102ae3:	6a 00                	push   $0x0
  pushl $107
c0102ae5:	6a 6b                	push   $0x6b
  jmp __alltraps
c0102ae7:	e9 28 fc ff ff       	jmp    c0102714 <__alltraps>

c0102aec <vector108>:
.globl vector108
vector108:
  pushl $0
c0102aec:	6a 00                	push   $0x0
  pushl $108
c0102aee:	6a 6c                	push   $0x6c
  jmp __alltraps
c0102af0:	e9 1f fc ff ff       	jmp    c0102714 <__alltraps>

c0102af5 <vector109>:
.globl vector109
vector109:
  pushl $0
c0102af5:	6a 00                	push   $0x0
  pushl $109
c0102af7:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102af9:	e9 16 fc ff ff       	jmp    c0102714 <__alltraps>

c0102afe <vector110>:
.globl vector110
vector110:
  pushl $0
c0102afe:	6a 00                	push   $0x0
  pushl $110
c0102b00:	6a 6e                	push   $0x6e
  jmp __alltraps
c0102b02:	e9 0d fc ff ff       	jmp    c0102714 <__alltraps>

c0102b07 <vector111>:
.globl vector111
vector111:
  pushl $0
c0102b07:	6a 00                	push   $0x0
  pushl $111
c0102b09:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102b0b:	e9 04 fc ff ff       	jmp    c0102714 <__alltraps>

c0102b10 <vector112>:
.globl vector112
vector112:
  pushl $0
c0102b10:	6a 00                	push   $0x0
  pushl $112
c0102b12:	6a 70                	push   $0x70
  jmp __alltraps
c0102b14:	e9 fb fb ff ff       	jmp    c0102714 <__alltraps>

c0102b19 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102b19:	6a 00                	push   $0x0
  pushl $113
c0102b1b:	6a 71                	push   $0x71
  jmp __alltraps
c0102b1d:	e9 f2 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b22 <vector114>:
.globl vector114
vector114:
  pushl $0
c0102b22:	6a 00                	push   $0x0
  pushl $114
c0102b24:	6a 72                	push   $0x72
  jmp __alltraps
c0102b26:	e9 e9 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b2b <vector115>:
.globl vector115
vector115:
  pushl $0
c0102b2b:	6a 00                	push   $0x0
  pushl $115
c0102b2d:	6a 73                	push   $0x73
  jmp __alltraps
c0102b2f:	e9 e0 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b34 <vector116>:
.globl vector116
vector116:
  pushl $0
c0102b34:	6a 00                	push   $0x0
  pushl $116
c0102b36:	6a 74                	push   $0x74
  jmp __alltraps
c0102b38:	e9 d7 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b3d <vector117>:
.globl vector117
vector117:
  pushl $0
c0102b3d:	6a 00                	push   $0x0
  pushl $117
c0102b3f:	6a 75                	push   $0x75
  jmp __alltraps
c0102b41:	e9 ce fb ff ff       	jmp    c0102714 <__alltraps>

c0102b46 <vector118>:
.globl vector118
vector118:
  pushl $0
c0102b46:	6a 00                	push   $0x0
  pushl $118
c0102b48:	6a 76                	push   $0x76
  jmp __alltraps
c0102b4a:	e9 c5 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b4f <vector119>:
.globl vector119
vector119:
  pushl $0
c0102b4f:	6a 00                	push   $0x0
  pushl $119
c0102b51:	6a 77                	push   $0x77
  jmp __alltraps
c0102b53:	e9 bc fb ff ff       	jmp    c0102714 <__alltraps>

c0102b58 <vector120>:
.globl vector120
vector120:
  pushl $0
c0102b58:	6a 00                	push   $0x0
  pushl $120
c0102b5a:	6a 78                	push   $0x78
  jmp __alltraps
c0102b5c:	e9 b3 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b61 <vector121>:
.globl vector121
vector121:
  pushl $0
c0102b61:	6a 00                	push   $0x0
  pushl $121
c0102b63:	6a 79                	push   $0x79
  jmp __alltraps
c0102b65:	e9 aa fb ff ff       	jmp    c0102714 <__alltraps>

c0102b6a <vector122>:
.globl vector122
vector122:
  pushl $0
c0102b6a:	6a 00                	push   $0x0
  pushl $122
c0102b6c:	6a 7a                	push   $0x7a
  jmp __alltraps
c0102b6e:	e9 a1 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b73 <vector123>:
.globl vector123
vector123:
  pushl $0
c0102b73:	6a 00                	push   $0x0
  pushl $123
c0102b75:	6a 7b                	push   $0x7b
  jmp __alltraps
c0102b77:	e9 98 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b7c <vector124>:
.globl vector124
vector124:
  pushl $0
c0102b7c:	6a 00                	push   $0x0
  pushl $124
c0102b7e:	6a 7c                	push   $0x7c
  jmp __alltraps
c0102b80:	e9 8f fb ff ff       	jmp    c0102714 <__alltraps>

c0102b85 <vector125>:
.globl vector125
vector125:
  pushl $0
c0102b85:	6a 00                	push   $0x0
  pushl $125
c0102b87:	6a 7d                	push   $0x7d
  jmp __alltraps
c0102b89:	e9 86 fb ff ff       	jmp    c0102714 <__alltraps>

c0102b8e <vector126>:
.globl vector126
vector126:
  pushl $0
c0102b8e:	6a 00                	push   $0x0
  pushl $126
c0102b90:	6a 7e                	push   $0x7e
  jmp __alltraps
c0102b92:	e9 7d fb ff ff       	jmp    c0102714 <__alltraps>

c0102b97 <vector127>:
.globl vector127
vector127:
  pushl $0
c0102b97:	6a 00                	push   $0x0
  pushl $127
c0102b99:	6a 7f                	push   $0x7f
  jmp __alltraps
c0102b9b:	e9 74 fb ff ff       	jmp    c0102714 <__alltraps>

c0102ba0 <vector128>:
.globl vector128
vector128:
  pushl $0
c0102ba0:	6a 00                	push   $0x0
  pushl $128
c0102ba2:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c0102ba7:	e9 68 fb ff ff       	jmp    c0102714 <__alltraps>

c0102bac <vector129>:
.globl vector129
vector129:
  pushl $0
c0102bac:	6a 00                	push   $0x0
  pushl $129
c0102bae:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c0102bb3:	e9 5c fb ff ff       	jmp    c0102714 <__alltraps>

c0102bb8 <vector130>:
.globl vector130
vector130:
  pushl $0
c0102bb8:	6a 00                	push   $0x0
  pushl $130
c0102bba:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c0102bbf:	e9 50 fb ff ff       	jmp    c0102714 <__alltraps>

c0102bc4 <vector131>:
.globl vector131
vector131:
  pushl $0
c0102bc4:	6a 00                	push   $0x0
  pushl $131
c0102bc6:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c0102bcb:	e9 44 fb ff ff       	jmp    c0102714 <__alltraps>

c0102bd0 <vector132>:
.globl vector132
vector132:
  pushl $0
c0102bd0:	6a 00                	push   $0x0
  pushl $132
c0102bd2:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c0102bd7:	e9 38 fb ff ff       	jmp    c0102714 <__alltraps>

c0102bdc <vector133>:
.globl vector133
vector133:
  pushl $0
c0102bdc:	6a 00                	push   $0x0
  pushl $133
c0102bde:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c0102be3:	e9 2c fb ff ff       	jmp    c0102714 <__alltraps>

c0102be8 <vector134>:
.globl vector134
vector134:
  pushl $0
c0102be8:	6a 00                	push   $0x0
  pushl $134
c0102bea:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c0102bef:	e9 20 fb ff ff       	jmp    c0102714 <__alltraps>

c0102bf4 <vector135>:
.globl vector135
vector135:
  pushl $0
c0102bf4:	6a 00                	push   $0x0
  pushl $135
c0102bf6:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102bfb:	e9 14 fb ff ff       	jmp    c0102714 <__alltraps>

c0102c00 <vector136>:
.globl vector136
vector136:
  pushl $0
c0102c00:	6a 00                	push   $0x0
  pushl $136
c0102c02:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c0102c07:	e9 08 fb ff ff       	jmp    c0102714 <__alltraps>

c0102c0c <vector137>:
.globl vector137
vector137:
  pushl $0
c0102c0c:	6a 00                	push   $0x0
  pushl $137
c0102c0e:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c0102c13:	e9 fc fa ff ff       	jmp    c0102714 <__alltraps>

c0102c18 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102c18:	6a 00                	push   $0x0
  pushl $138
c0102c1a:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c0102c1f:	e9 f0 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c24 <vector139>:
.globl vector139
vector139:
  pushl $0
c0102c24:	6a 00                	push   $0x0
  pushl $139
c0102c26:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102c2b:	e9 e4 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c30 <vector140>:
.globl vector140
vector140:
  pushl $0
c0102c30:	6a 00                	push   $0x0
  pushl $140
c0102c32:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c0102c37:	e9 d8 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c3c <vector141>:
.globl vector141
vector141:
  pushl $0
c0102c3c:	6a 00                	push   $0x0
  pushl $141
c0102c3e:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c0102c43:	e9 cc fa ff ff       	jmp    c0102714 <__alltraps>

c0102c48 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102c48:	6a 00                	push   $0x0
  pushl $142
c0102c4a:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c0102c4f:	e9 c0 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c54 <vector143>:
.globl vector143
vector143:
  pushl $0
c0102c54:	6a 00                	push   $0x0
  pushl $143
c0102c56:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c0102c5b:	e9 b4 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c60 <vector144>:
.globl vector144
vector144:
  pushl $0
c0102c60:	6a 00                	push   $0x0
  pushl $144
c0102c62:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c0102c67:	e9 a8 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c6c <vector145>:
.globl vector145
vector145:
  pushl $0
c0102c6c:	6a 00                	push   $0x0
  pushl $145
c0102c6e:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c0102c73:	e9 9c fa ff ff       	jmp    c0102714 <__alltraps>

c0102c78 <vector146>:
.globl vector146
vector146:
  pushl $0
c0102c78:	6a 00                	push   $0x0
  pushl $146
c0102c7a:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c0102c7f:	e9 90 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c84 <vector147>:
.globl vector147
vector147:
  pushl $0
c0102c84:	6a 00                	push   $0x0
  pushl $147
c0102c86:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c0102c8b:	e9 84 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c90 <vector148>:
.globl vector148
vector148:
  pushl $0
c0102c90:	6a 00                	push   $0x0
  pushl $148
c0102c92:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c0102c97:	e9 78 fa ff ff       	jmp    c0102714 <__alltraps>

c0102c9c <vector149>:
.globl vector149
vector149:
  pushl $0
c0102c9c:	6a 00                	push   $0x0
  pushl $149
c0102c9e:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c0102ca3:	e9 6c fa ff ff       	jmp    c0102714 <__alltraps>

c0102ca8 <vector150>:
.globl vector150
vector150:
  pushl $0
c0102ca8:	6a 00                	push   $0x0
  pushl $150
c0102caa:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c0102caf:	e9 60 fa ff ff       	jmp    c0102714 <__alltraps>

c0102cb4 <vector151>:
.globl vector151
vector151:
  pushl $0
c0102cb4:	6a 00                	push   $0x0
  pushl $151
c0102cb6:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c0102cbb:	e9 54 fa ff ff       	jmp    c0102714 <__alltraps>

c0102cc0 <vector152>:
.globl vector152
vector152:
  pushl $0
c0102cc0:	6a 00                	push   $0x0
  pushl $152
c0102cc2:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c0102cc7:	e9 48 fa ff ff       	jmp    c0102714 <__alltraps>

c0102ccc <vector153>:
.globl vector153
vector153:
  pushl $0
c0102ccc:	6a 00                	push   $0x0
  pushl $153
c0102cce:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c0102cd3:	e9 3c fa ff ff       	jmp    c0102714 <__alltraps>

c0102cd8 <vector154>:
.globl vector154
vector154:
  pushl $0
c0102cd8:	6a 00                	push   $0x0
  pushl $154
c0102cda:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c0102cdf:	e9 30 fa ff ff       	jmp    c0102714 <__alltraps>

c0102ce4 <vector155>:
.globl vector155
vector155:
  pushl $0
c0102ce4:	6a 00                	push   $0x0
  pushl $155
c0102ce6:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c0102ceb:	e9 24 fa ff ff       	jmp    c0102714 <__alltraps>

c0102cf0 <vector156>:
.globl vector156
vector156:
  pushl $0
c0102cf0:	6a 00                	push   $0x0
  pushl $156
c0102cf2:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c0102cf7:	e9 18 fa ff ff       	jmp    c0102714 <__alltraps>

c0102cfc <vector157>:
.globl vector157
vector157:
  pushl $0
c0102cfc:	6a 00                	push   $0x0
  pushl $157
c0102cfe:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c0102d03:	e9 0c fa ff ff       	jmp    c0102714 <__alltraps>

c0102d08 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102d08:	6a 00                	push   $0x0
  pushl $158
c0102d0a:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c0102d0f:	e9 00 fa ff ff       	jmp    c0102714 <__alltraps>

c0102d14 <vector159>:
.globl vector159
vector159:
  pushl $0
c0102d14:	6a 00                	push   $0x0
  pushl $159
c0102d16:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102d1b:	e9 f4 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d20 <vector160>:
.globl vector160
vector160:
  pushl $0
c0102d20:	6a 00                	push   $0x0
  pushl $160
c0102d22:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c0102d27:	e9 e8 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d2c <vector161>:
.globl vector161
vector161:
  pushl $0
c0102d2c:	6a 00                	push   $0x0
  pushl $161
c0102d2e:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c0102d33:	e9 dc f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d38 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102d38:	6a 00                	push   $0x0
  pushl $162
c0102d3a:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c0102d3f:	e9 d0 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d44 <vector163>:
.globl vector163
vector163:
  pushl $0
c0102d44:	6a 00                	push   $0x0
  pushl $163
c0102d46:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102d4b:	e9 c4 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d50 <vector164>:
.globl vector164
vector164:
  pushl $0
c0102d50:	6a 00                	push   $0x0
  pushl $164
c0102d52:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c0102d57:	e9 b8 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d5c <vector165>:
.globl vector165
vector165:
  pushl $0
c0102d5c:	6a 00                	push   $0x0
  pushl $165
c0102d5e:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c0102d63:	e9 ac f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d68 <vector166>:
.globl vector166
vector166:
  pushl $0
c0102d68:	6a 00                	push   $0x0
  pushl $166
c0102d6a:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c0102d6f:	e9 a0 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d74 <vector167>:
.globl vector167
vector167:
  pushl $0
c0102d74:	6a 00                	push   $0x0
  pushl $167
c0102d76:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c0102d7b:	e9 94 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d80 <vector168>:
.globl vector168
vector168:
  pushl $0
c0102d80:	6a 00                	push   $0x0
  pushl $168
c0102d82:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c0102d87:	e9 88 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d8c <vector169>:
.globl vector169
vector169:
  pushl $0
c0102d8c:	6a 00                	push   $0x0
  pushl $169
c0102d8e:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c0102d93:	e9 7c f9 ff ff       	jmp    c0102714 <__alltraps>

c0102d98 <vector170>:
.globl vector170
vector170:
  pushl $0
c0102d98:	6a 00                	push   $0x0
  pushl $170
c0102d9a:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c0102d9f:	e9 70 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102da4 <vector171>:
.globl vector171
vector171:
  pushl $0
c0102da4:	6a 00                	push   $0x0
  pushl $171
c0102da6:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c0102dab:	e9 64 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102db0 <vector172>:
.globl vector172
vector172:
  pushl $0
c0102db0:	6a 00                	push   $0x0
  pushl $172
c0102db2:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c0102db7:	e9 58 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102dbc <vector173>:
.globl vector173
vector173:
  pushl $0
c0102dbc:	6a 00                	push   $0x0
  pushl $173
c0102dbe:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c0102dc3:	e9 4c f9 ff ff       	jmp    c0102714 <__alltraps>

c0102dc8 <vector174>:
.globl vector174
vector174:
  pushl $0
c0102dc8:	6a 00                	push   $0x0
  pushl $174
c0102dca:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c0102dcf:	e9 40 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102dd4 <vector175>:
.globl vector175
vector175:
  pushl $0
c0102dd4:	6a 00                	push   $0x0
  pushl $175
c0102dd6:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c0102ddb:	e9 34 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102de0 <vector176>:
.globl vector176
vector176:
  pushl $0
c0102de0:	6a 00                	push   $0x0
  pushl $176
c0102de2:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c0102de7:	e9 28 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102dec <vector177>:
.globl vector177
vector177:
  pushl $0
c0102dec:	6a 00                	push   $0x0
  pushl $177
c0102dee:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c0102df3:	e9 1c f9 ff ff       	jmp    c0102714 <__alltraps>

c0102df8 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102df8:	6a 00                	push   $0x0
  pushl $178
c0102dfa:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c0102dff:	e9 10 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102e04 <vector179>:
.globl vector179
vector179:
  pushl $0
c0102e04:	6a 00                	push   $0x0
  pushl $179
c0102e06:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102e0b:	e9 04 f9 ff ff       	jmp    c0102714 <__alltraps>

c0102e10 <vector180>:
.globl vector180
vector180:
  pushl $0
c0102e10:	6a 00                	push   $0x0
  pushl $180
c0102e12:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c0102e17:	e9 f8 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e1c <vector181>:
.globl vector181
vector181:
  pushl $0
c0102e1c:	6a 00                	push   $0x0
  pushl $181
c0102e1e:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c0102e23:	e9 ec f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e28 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102e28:	6a 00                	push   $0x0
  pushl $182
c0102e2a:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c0102e2f:	e9 e0 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e34 <vector183>:
.globl vector183
vector183:
  pushl $0
c0102e34:	6a 00                	push   $0x0
  pushl $183
c0102e36:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102e3b:	e9 d4 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e40 <vector184>:
.globl vector184
vector184:
  pushl $0
c0102e40:	6a 00                	push   $0x0
  pushl $184
c0102e42:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c0102e47:	e9 c8 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e4c <vector185>:
.globl vector185
vector185:
  pushl $0
c0102e4c:	6a 00                	push   $0x0
  pushl $185
c0102e4e:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c0102e53:	e9 bc f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e58 <vector186>:
.globl vector186
vector186:
  pushl $0
c0102e58:	6a 00                	push   $0x0
  pushl $186
c0102e5a:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c0102e5f:	e9 b0 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e64 <vector187>:
.globl vector187
vector187:
  pushl $0
c0102e64:	6a 00                	push   $0x0
  pushl $187
c0102e66:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c0102e6b:	e9 a4 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e70 <vector188>:
.globl vector188
vector188:
  pushl $0
c0102e70:	6a 00                	push   $0x0
  pushl $188
c0102e72:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c0102e77:	e9 98 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e7c <vector189>:
.globl vector189
vector189:
  pushl $0
c0102e7c:	6a 00                	push   $0x0
  pushl $189
c0102e7e:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c0102e83:	e9 8c f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e88 <vector190>:
.globl vector190
vector190:
  pushl $0
c0102e88:	6a 00                	push   $0x0
  pushl $190
c0102e8a:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c0102e8f:	e9 80 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102e94 <vector191>:
.globl vector191
vector191:
  pushl $0
c0102e94:	6a 00                	push   $0x0
  pushl $191
c0102e96:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c0102e9b:	e9 74 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102ea0 <vector192>:
.globl vector192
vector192:
  pushl $0
c0102ea0:	6a 00                	push   $0x0
  pushl $192
c0102ea2:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c0102ea7:	e9 68 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102eac <vector193>:
.globl vector193
vector193:
  pushl $0
c0102eac:	6a 00                	push   $0x0
  pushl $193
c0102eae:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c0102eb3:	e9 5c f8 ff ff       	jmp    c0102714 <__alltraps>

c0102eb8 <vector194>:
.globl vector194
vector194:
  pushl $0
c0102eb8:	6a 00                	push   $0x0
  pushl $194
c0102eba:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c0102ebf:	e9 50 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102ec4 <vector195>:
.globl vector195
vector195:
  pushl $0
c0102ec4:	6a 00                	push   $0x0
  pushl $195
c0102ec6:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c0102ecb:	e9 44 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102ed0 <vector196>:
.globl vector196
vector196:
  pushl $0
c0102ed0:	6a 00                	push   $0x0
  pushl $196
c0102ed2:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c0102ed7:	e9 38 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102edc <vector197>:
.globl vector197
vector197:
  pushl $0
c0102edc:	6a 00                	push   $0x0
  pushl $197
c0102ede:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c0102ee3:	e9 2c f8 ff ff       	jmp    c0102714 <__alltraps>

c0102ee8 <vector198>:
.globl vector198
vector198:
  pushl $0
c0102ee8:	6a 00                	push   $0x0
  pushl $198
c0102eea:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c0102eef:	e9 20 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102ef4 <vector199>:
.globl vector199
vector199:
  pushl $0
c0102ef4:	6a 00                	push   $0x0
  pushl $199
c0102ef6:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102efb:	e9 14 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102f00 <vector200>:
.globl vector200
vector200:
  pushl $0
c0102f00:	6a 00                	push   $0x0
  pushl $200
c0102f02:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102f07:	e9 08 f8 ff ff       	jmp    c0102714 <__alltraps>

c0102f0c <vector201>:
.globl vector201
vector201:
  pushl $0
c0102f0c:	6a 00                	push   $0x0
  pushl $201
c0102f0e:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c0102f13:	e9 fc f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f18 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102f18:	6a 00                	push   $0x0
  pushl $202
c0102f1a:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c0102f1f:	e9 f0 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f24 <vector203>:
.globl vector203
vector203:
  pushl $0
c0102f24:	6a 00                	push   $0x0
  pushl $203
c0102f26:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102f2b:	e9 e4 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f30 <vector204>:
.globl vector204
vector204:
  pushl $0
c0102f30:	6a 00                	push   $0x0
  pushl $204
c0102f32:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102f37:	e9 d8 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f3c <vector205>:
.globl vector205
vector205:
  pushl $0
c0102f3c:	6a 00                	push   $0x0
  pushl $205
c0102f3e:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c0102f43:	e9 cc f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f48 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102f48:	6a 00                	push   $0x0
  pushl $206
c0102f4a:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c0102f4f:	e9 c0 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f54 <vector207>:
.globl vector207
vector207:
  pushl $0
c0102f54:	6a 00                	push   $0x0
  pushl $207
c0102f56:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c0102f5b:	e9 b4 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f60 <vector208>:
.globl vector208
vector208:
  pushl $0
c0102f60:	6a 00                	push   $0x0
  pushl $208
c0102f62:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c0102f67:	e9 a8 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f6c <vector209>:
.globl vector209
vector209:
  pushl $0
c0102f6c:	6a 00                	push   $0x0
  pushl $209
c0102f6e:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c0102f73:	e9 9c f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f78 <vector210>:
.globl vector210
vector210:
  pushl $0
c0102f78:	6a 00                	push   $0x0
  pushl $210
c0102f7a:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c0102f7f:	e9 90 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f84 <vector211>:
.globl vector211
vector211:
  pushl $0
c0102f84:	6a 00                	push   $0x0
  pushl $211
c0102f86:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c0102f8b:	e9 84 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f90 <vector212>:
.globl vector212
vector212:
  pushl $0
c0102f90:	6a 00                	push   $0x0
  pushl $212
c0102f92:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c0102f97:	e9 78 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102f9c <vector213>:
.globl vector213
vector213:
  pushl $0
c0102f9c:	6a 00                	push   $0x0
  pushl $213
c0102f9e:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c0102fa3:	e9 6c f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fa8 <vector214>:
.globl vector214
vector214:
  pushl $0
c0102fa8:	6a 00                	push   $0x0
  pushl $214
c0102faa:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c0102faf:	e9 60 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fb4 <vector215>:
.globl vector215
vector215:
  pushl $0
c0102fb4:	6a 00                	push   $0x0
  pushl $215
c0102fb6:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c0102fbb:	e9 54 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fc0 <vector216>:
.globl vector216
vector216:
  pushl $0
c0102fc0:	6a 00                	push   $0x0
  pushl $216
c0102fc2:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c0102fc7:	e9 48 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fcc <vector217>:
.globl vector217
vector217:
  pushl $0
c0102fcc:	6a 00                	push   $0x0
  pushl $217
c0102fce:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c0102fd3:	e9 3c f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fd8 <vector218>:
.globl vector218
vector218:
  pushl $0
c0102fd8:	6a 00                	push   $0x0
  pushl $218
c0102fda:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c0102fdf:	e9 30 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102fe4 <vector219>:
.globl vector219
vector219:
  pushl $0
c0102fe4:	6a 00                	push   $0x0
  pushl $219
c0102fe6:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c0102feb:	e9 24 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102ff0 <vector220>:
.globl vector220
vector220:
  pushl $0
c0102ff0:	6a 00                	push   $0x0
  pushl $220
c0102ff2:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0102ff7:	e9 18 f7 ff ff       	jmp    c0102714 <__alltraps>

c0102ffc <vector221>:
.globl vector221
vector221:
  pushl $0
c0102ffc:	6a 00                	push   $0x0
  pushl $221
c0102ffe:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c0103003:	e9 0c f7 ff ff       	jmp    c0102714 <__alltraps>

c0103008 <vector222>:
.globl vector222
vector222:
  pushl $0
c0103008:	6a 00                	push   $0x0
  pushl $222
c010300a:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c010300f:	e9 00 f7 ff ff       	jmp    c0102714 <__alltraps>

c0103014 <vector223>:
.globl vector223
vector223:
  pushl $0
c0103014:	6a 00                	push   $0x0
  pushl $223
c0103016:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c010301b:	e9 f4 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103020 <vector224>:
.globl vector224
vector224:
  pushl $0
c0103020:	6a 00                	push   $0x0
  pushl $224
c0103022:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c0103027:	e9 e8 f6 ff ff       	jmp    c0102714 <__alltraps>

c010302c <vector225>:
.globl vector225
vector225:
  pushl $0
c010302c:	6a 00                	push   $0x0
  pushl $225
c010302e:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c0103033:	e9 dc f6 ff ff       	jmp    c0102714 <__alltraps>

c0103038 <vector226>:
.globl vector226
vector226:
  pushl $0
c0103038:	6a 00                	push   $0x0
  pushl $226
c010303a:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c010303f:	e9 d0 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103044 <vector227>:
.globl vector227
vector227:
  pushl $0
c0103044:	6a 00                	push   $0x0
  pushl $227
c0103046:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c010304b:	e9 c4 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103050 <vector228>:
.globl vector228
vector228:
  pushl $0
c0103050:	6a 00                	push   $0x0
  pushl $228
c0103052:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c0103057:	e9 b8 f6 ff ff       	jmp    c0102714 <__alltraps>

c010305c <vector229>:
.globl vector229
vector229:
  pushl $0
c010305c:	6a 00                	push   $0x0
  pushl $229
c010305e:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c0103063:	e9 ac f6 ff ff       	jmp    c0102714 <__alltraps>

c0103068 <vector230>:
.globl vector230
vector230:
  pushl $0
c0103068:	6a 00                	push   $0x0
  pushl $230
c010306a:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c010306f:	e9 a0 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103074 <vector231>:
.globl vector231
vector231:
  pushl $0
c0103074:	6a 00                	push   $0x0
  pushl $231
c0103076:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c010307b:	e9 94 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103080 <vector232>:
.globl vector232
vector232:
  pushl $0
c0103080:	6a 00                	push   $0x0
  pushl $232
c0103082:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c0103087:	e9 88 f6 ff ff       	jmp    c0102714 <__alltraps>

c010308c <vector233>:
.globl vector233
vector233:
  pushl $0
c010308c:	6a 00                	push   $0x0
  pushl $233
c010308e:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c0103093:	e9 7c f6 ff ff       	jmp    c0102714 <__alltraps>

c0103098 <vector234>:
.globl vector234
vector234:
  pushl $0
c0103098:	6a 00                	push   $0x0
  pushl $234
c010309a:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c010309f:	e9 70 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030a4 <vector235>:
.globl vector235
vector235:
  pushl $0
c01030a4:	6a 00                	push   $0x0
  pushl $235
c01030a6:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c01030ab:	e9 64 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030b0 <vector236>:
.globl vector236
vector236:
  pushl $0
c01030b0:	6a 00                	push   $0x0
  pushl $236
c01030b2:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c01030b7:	e9 58 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030bc <vector237>:
.globl vector237
vector237:
  pushl $0
c01030bc:	6a 00                	push   $0x0
  pushl $237
c01030be:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c01030c3:	e9 4c f6 ff ff       	jmp    c0102714 <__alltraps>

c01030c8 <vector238>:
.globl vector238
vector238:
  pushl $0
c01030c8:	6a 00                	push   $0x0
  pushl $238
c01030ca:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c01030cf:	e9 40 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030d4 <vector239>:
.globl vector239
vector239:
  pushl $0
c01030d4:	6a 00                	push   $0x0
  pushl $239
c01030d6:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c01030db:	e9 34 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030e0 <vector240>:
.globl vector240
vector240:
  pushl $0
c01030e0:	6a 00                	push   $0x0
  pushl $240
c01030e2:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c01030e7:	e9 28 f6 ff ff       	jmp    c0102714 <__alltraps>

c01030ec <vector241>:
.globl vector241
vector241:
  pushl $0
c01030ec:	6a 00                	push   $0x0
  pushl $241
c01030ee:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c01030f3:	e9 1c f6 ff ff       	jmp    c0102714 <__alltraps>

c01030f8 <vector242>:
.globl vector242
vector242:
  pushl $0
c01030f8:	6a 00                	push   $0x0
  pushl $242
c01030fa:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c01030ff:	e9 10 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103104 <vector243>:
.globl vector243
vector243:
  pushl $0
c0103104:	6a 00                	push   $0x0
  pushl $243
c0103106:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c010310b:	e9 04 f6 ff ff       	jmp    c0102714 <__alltraps>

c0103110 <vector244>:
.globl vector244
vector244:
  pushl $0
c0103110:	6a 00                	push   $0x0
  pushl $244
c0103112:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c0103117:	e9 f8 f5 ff ff       	jmp    c0102714 <__alltraps>

c010311c <vector245>:
.globl vector245
vector245:
  pushl $0
c010311c:	6a 00                	push   $0x0
  pushl $245
c010311e:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c0103123:	e9 ec f5 ff ff       	jmp    c0102714 <__alltraps>

c0103128 <vector246>:
.globl vector246
vector246:
  pushl $0
c0103128:	6a 00                	push   $0x0
  pushl $246
c010312a:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c010312f:	e9 e0 f5 ff ff       	jmp    c0102714 <__alltraps>

c0103134 <vector247>:
.globl vector247
vector247:
  pushl $0
c0103134:	6a 00                	push   $0x0
  pushl $247
c0103136:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c010313b:	e9 d4 f5 ff ff       	jmp    c0102714 <__alltraps>

c0103140 <vector248>:
.globl vector248
vector248:
  pushl $0
c0103140:	6a 00                	push   $0x0
  pushl $248
c0103142:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c0103147:	e9 c8 f5 ff ff       	jmp    c0102714 <__alltraps>

c010314c <vector249>:
.globl vector249
vector249:
  pushl $0
c010314c:	6a 00                	push   $0x0
  pushl $249
c010314e:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c0103153:	e9 bc f5 ff ff       	jmp    c0102714 <__alltraps>

c0103158 <vector250>:
.globl vector250
vector250:
  pushl $0
c0103158:	6a 00                	push   $0x0
  pushl $250
c010315a:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c010315f:	e9 b0 f5 ff ff       	jmp    c0102714 <__alltraps>

c0103164 <vector251>:
.globl vector251
vector251:
  pushl $0
c0103164:	6a 00                	push   $0x0
  pushl $251
c0103166:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c010316b:	e9 a4 f5 ff ff       	jmp    c0102714 <__alltraps>

c0103170 <vector252>:
.globl vector252
vector252:
  pushl $0
c0103170:	6a 00                	push   $0x0
  pushl $252
c0103172:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c0103177:	e9 98 f5 ff ff       	jmp    c0102714 <__alltraps>

c010317c <vector253>:
.globl vector253
vector253:
  pushl $0
c010317c:	6a 00                	push   $0x0
  pushl $253
c010317e:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c0103183:	e9 8c f5 ff ff       	jmp    c0102714 <__alltraps>

c0103188 <vector254>:
.globl vector254
vector254:
  pushl $0
c0103188:	6a 00                	push   $0x0
  pushl $254
c010318a:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c010318f:	e9 80 f5 ff ff       	jmp    c0102714 <__alltraps>

c0103194 <vector255>:
.globl vector255
vector255:
  pushl $0
c0103194:	6a 00                	push   $0x0
  pushl $255
c0103196:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c010319b:	e9 74 f5 ff ff       	jmp    c0102714 <__alltraps>

c01031a0 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c01031a0:	55                   	push   %ebp
c01031a1:	89 e5                	mov    %esp,%ebp
	return page - pages;
c01031a3:	8b 55 08             	mov    0x8(%ebp),%edx
c01031a6:	a1 98 ba 11 c0       	mov    0xc011ba98,%eax
c01031ab:	89 d1                	mov    %edx,%ecx
c01031ad:	29 c1                	sub    %eax,%ecx
c01031af:	89 c8                	mov    %ecx,%eax
c01031b1:	c1 f8 03             	sar    $0x3,%eax
c01031b4:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
}
c01031ba:	5d                   	pop    %ebp
c01031bb:	c3                   	ret    

c01031bc <set_page_ref>:
page_ref(struct Page *page) {
	return atomic_read(&(page->ref));
}

static inline void
set_page_ref(struct Page *page, int val) {
c01031bc:	55                   	push   %ebp
c01031bd:	89 e5                	mov    %esp,%ebp
c01031bf:	83 ec 10             	sub    $0x10,%esp
	atomic_set(&(page->ref), val);
c01031c2:	8b 45 08             	mov    0x8(%ebp),%eax
c01031c5:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01031c8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01031cb:	89 45 f8             	mov    %eax,-0x8(%ebp)
 *
 * Atomically sets the value of @v to @i.
 * */
static inline void
atomic_set(atomic_t *v, int i) {
	v->counter = i;
c01031ce:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01031d1:	8b 55 f8             	mov    -0x8(%ebp),%edx
c01031d4:	89 10                	mov    %edx,(%eax)
}
c01031d6:	c9                   	leave  
c01031d7:	c3                   	ret    

c01031d8 <buddy_init>:
struct Zone {
	struct Page *mem_base;
} zones[MAX_ZONE_NUM] = {{NULL}};

static void
buddy_init(void) {
c01031d8:	55                   	push   %ebp
c01031d9:	89 e5                	mov    %esp,%ebp
c01031db:	83 ec 10             	sub    $0x10,%esp
	int i;
	for (i = 0; i <= MAX_ORDER; i ++) {
c01031de:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c01031e5:	eb 44                	jmp    c010322b <buddy_init+0x53>
		list_init(&free_list(i));
c01031e7:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01031ea:	89 d0                	mov    %edx,%eax
c01031ec:	01 c0                	add    %eax,%eax
c01031ee:	01 d0                	add    %edx,%eax
c01031f0:	c1 e0 02             	shl    $0x2,%eax
c01031f3:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01031f8:	89 45 f8             	mov    %eax,-0x8(%ebp)
 * list_init - initialize a new entry
 * @elm:		new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
	elm->prev = elm->next = elm;
c01031fb:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031fe:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0103201:	89 50 04             	mov    %edx,0x4(%eax)
c0103204:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0103207:	8b 50 04             	mov    0x4(%eax),%edx
c010320a:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010320d:	89 10                	mov    %edx,(%eax)
		nr_free(i) = 0;
c010320f:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103212:	89 d0                	mov    %edx,%eax
c0103214:	01 c0                	add    %eax,%eax
c0103216:	01 d0                	add    %edx,%eax
c0103218:	c1 e0 02             	shl    $0x2,%eax
c010321b:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103220:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
} zones[MAX_ZONE_NUM] = {{NULL}};

static void
buddy_init(void) {
	int i;
	for (i = 0; i <= MAX_ORDER; i ++) {
c0103227:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c010322b:	83 7d fc 0a          	cmpl   $0xa,-0x4(%ebp)
c010322f:	7e b6                	jle    c01031e7 <buddy_init+0xf>
		list_init(&free_list(i));
		nr_free(i) = 0;
	}
}
c0103231:	c9                   	leave  
c0103232:	c3                   	ret    

c0103233 <buddy_init_memmap>:

static void
buddy_init_memmap(struct Page *base, size_t n) {
c0103233:	55                   	push   %ebp
c0103234:	89 e5                	mov    %esp,%ebp
c0103236:	53                   	push   %ebx
c0103237:	83 ec 54             	sub    $0x54,%esp
	static int zone_num = 0;
	assert(n > 0 && zone_num < MAX_ZONE_NUM);
c010323a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010323e:	74 0a                	je     c010324a <buddy_init_memmap+0x17>
c0103240:	a1 e4 b9 11 c0       	mov    0xc011b9e4,%eax
c0103245:	83 f8 09             	cmp    $0x9,%eax
c0103248:	7e 24                	jle    c010326e <buddy_init_memmap+0x3b>
c010324a:	c7 44 24 0c 10 7a 10 	movl   $0xc0107a10,0xc(%esp)
c0103251:	c0 
c0103252:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103259:	c0 
c010325a:	c7 44 24 04 1e 00 00 	movl   $0x1e,0x4(%esp)
c0103261:	00 
c0103262:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103269:	e8 96 e3 ff ff       	call   c0101604 <__panic>
	struct Page *p = base;
c010326e:	8b 45 08             	mov    0x8(%ebp),%eax
c0103271:	89 45 f4             	mov    %eax,-0xc(%ebp)
	for (; p != base + n; p ++) {
c0103274:	e9 89 00 00 00       	jmp    c0103302 <buddy_init_memmap+0xcf>
		assert(PageReserved(p));
c0103279:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010327c:	83 c0 04             	add    $0x4,%eax
c010327f:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0103286:	89 45 e4             	mov    %eax,-0x1c(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103289:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010328c:	8b 55 e8             	mov    -0x18(%ebp),%edx
c010328f:	0f a3 10             	bt     %edx,(%eax)
c0103292:	19 db                	sbb    %ebx,%ebx
c0103294:	89 5d e0             	mov    %ebx,-0x20(%ebp)
	return oldbit != 0;
c0103297:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010329b:	0f 95 c0             	setne  %al
c010329e:	0f b6 c0             	movzbl %al,%eax
c01032a1:	85 c0                	test   %eax,%eax
c01032a3:	75 24                	jne    c01032c9 <buddy_init_memmap+0x96>
c01032a5:	c7 44 24 0c 5a 7a 10 	movl   $0xc0107a5a,0xc(%esp)
c01032ac:	c0 
c01032ad:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01032b4:	c0 
c01032b5:	c7 44 24 04 21 00 00 	movl   $0x21,0x4(%esp)
c01032bc:	00 
c01032bd:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01032c4:	e8 3b e3 ff ff       	call   c0101604 <__panic>
		p->flags = p->property = 0;
c01032c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032cc:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
c01032d3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032d6:	8b 50 08             	mov    0x8(%eax),%edx
c01032d9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032dc:	89 50 04             	mov    %edx,0x4(%eax)
		p->zone_num = zone_num;
c01032df:	8b 15 e4 b9 11 c0    	mov    0xc011b9e4,%edx
c01032e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032e8:	89 50 0c             	mov    %edx,0xc(%eax)
		set_page_ref(p, 0);
c01032eb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01032f2:	00 
c01032f3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032f6:	89 04 24             	mov    %eax,(%esp)
c01032f9:	e8 be fe ff ff       	call   c01031bc <set_page_ref>
static void
buddy_init_memmap(struct Page *base, size_t n) {
	static int zone_num = 0;
	assert(n > 0 && zone_num < MAX_ZONE_NUM);
	struct Page *p = base;
	for (; p != base + n; p ++) {
c01032fe:	83 45 f4 18          	addl   $0x18,-0xc(%ebp)
c0103302:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103305:	89 d0                	mov    %edx,%eax
c0103307:	01 c0                	add    %eax,%eax
c0103309:	01 d0                	add    %edx,%eax
c010330b:	c1 e0 03             	shl    $0x3,%eax
c010330e:	03 45 08             	add    0x8(%ebp),%eax
c0103311:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c0103314:	0f 85 5f ff ff ff    	jne    c0103279 <buddy_init_memmap+0x46>
		assert(PageReserved(p));
		p->flags = p->property = 0;
		p->zone_num = zone_num;
		set_page_ref(p, 0);
	}
	p = zones[zone_num ++].mem_base = base;
c010331a:	a1 e4 b9 11 c0       	mov    0xc011b9e4,%eax
c010331f:	8b 55 08             	mov    0x8(%ebp),%edx
c0103322:	89 14 85 20 b9 11 c0 	mov    %edx,-0x3fee46e0(,%eax,4)
c0103329:	8b 14 85 20 b9 11 c0 	mov    -0x3fee46e0(,%eax,4),%edx
c0103330:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0103333:	83 c0 01             	add    $0x1,%eax
c0103336:	a3 e4 b9 11 c0       	mov    %eax,0xc011b9e4
	size_t order = MAX_ORDER, order_size = (1 << order);
c010333b:	c7 45 f0 0a 00 00 00 	movl   $0xa,-0x10(%ebp)
c0103342:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103345:	ba 01 00 00 00       	mov    $0x1,%edx
c010334a:	89 d3                	mov    %edx,%ebx
c010334c:	89 c1                	mov    %eax,%ecx
c010334e:	d3 e3                	shl    %cl,%ebx
c0103350:	89 d8                	mov    %ebx,%eax
c0103352:	89 45 ec             	mov    %eax,-0x14(%ebp)
	while (n != 0) {
c0103355:	e9 d7 00 00 00       	jmp    c0103431 <buddy_init_memmap+0x1fe>
		while (n >= order_size) {
			p->property = order;
c010335a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010335d:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103360:	89 50 08             	mov    %edx,0x8(%eax)
			SetPageProperty(p);
c0103363:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103366:	83 c0 04             	add    $0x4,%eax
c0103369:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
c0103370:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
	asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0103373:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103376:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103379:	0f ab 10             	bts    %edx,(%eax)
			list_add(&free_list(order), &(p->page_link));
c010337c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010337f:	8d 48 10             	lea    0x10(%eax),%ecx
c0103382:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103385:	89 d0                	mov    %edx,%eax
c0103387:	01 c0                	add    %eax,%eax
c0103389:	01 d0                	add    %edx,%eax
c010338b:	c1 e0 02             	shl    $0x2,%eax
c010338e:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103393:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0103396:	89 4d d0             	mov    %ecx,-0x30(%ebp)
c0103399:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010339c:	89 45 cc             	mov    %eax,-0x34(%ebp)
c010339f:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01033a2:	89 45 c8             	mov    %eax,-0x38(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
	__list_add(elm, listelm, listelm->next);
c01033a5:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01033a8:	8b 40 04             	mov    0x4(%eax),%eax
c01033ab:	8b 55 c8             	mov    -0x38(%ebp),%edx
c01033ae:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c01033b1:	8b 55 cc             	mov    -0x34(%ebp),%edx
c01033b4:	89 55 c0             	mov    %edx,-0x40(%ebp)
c01033b7:	89 45 bc             	mov    %eax,-0x44(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
	prev->next = next->prev = elm;
c01033ba:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01033bd:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01033c0:	89 10                	mov    %edx,(%eax)
c01033c2:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01033c5:	8b 10                	mov    (%eax),%edx
c01033c7:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01033ca:	89 50 04             	mov    %edx,0x4(%eax)
	elm->next = next;
c01033cd:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01033d0:	8b 55 bc             	mov    -0x44(%ebp),%edx
c01033d3:	89 50 04             	mov    %edx,0x4(%eax)
	elm->prev = prev;
c01033d6:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01033d9:	8b 55 c0             	mov    -0x40(%ebp),%edx
c01033dc:	89 10                	mov    %edx,(%eax)
			n -= order_size, p += order_size;
c01033de:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01033e1:	29 45 0c             	sub    %eax,0xc(%ebp)
c01033e4:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01033e7:	89 d0                	mov    %edx,%eax
c01033e9:	01 c0                	add    %eax,%eax
c01033eb:	01 d0                	add    %edx,%eax
c01033ed:	c1 e0 03             	shl    $0x3,%eax
c01033f0:	01 45 f4             	add    %eax,-0xc(%ebp)
			nr_free(order) ++;
c01033f3:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01033f6:	89 d0                	mov    %edx,%eax
c01033f8:	01 c0                	add    %eax,%eax
c01033fa:	01 d0                	add    %edx,%eax
c01033fc:	c1 e0 02             	shl    $0x2,%eax
c01033ff:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103404:	8b 40 08             	mov    0x8(%eax),%eax
c0103407:	8d 48 01             	lea    0x1(%eax),%ecx
c010340a:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010340d:	89 d0                	mov    %edx,%eax
c010340f:	01 c0                	add    %eax,%eax
c0103411:	01 d0                	add    %edx,%eax
c0103413:	c1 e0 02             	shl    $0x2,%eax
c0103416:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c010341b:	89 48 08             	mov    %ecx,0x8(%eax)
		set_page_ref(p, 0);
	}
	p = zones[zone_num ++].mem_base = base;
	size_t order = MAX_ORDER, order_size = (1 << order);
	while (n != 0) {
		while (n >= order_size) {
c010341e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103421:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0103424:	0f 83 30 ff ff ff    	jae    c010335a <buddy_init_memmap+0x127>
			SetPageProperty(p);
			list_add(&free_list(order), &(p->page_link));
			n -= order_size, p += order_size;
			nr_free(order) ++;
		}
		order --;
c010342a:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
		order_size >>= 1;
c010342e:	d1 6d ec             	shrl   -0x14(%ebp)
		p->zone_num = zone_num;
		set_page_ref(p, 0);
	}
	p = zones[zone_num ++].mem_base = base;
	size_t order = MAX_ORDER, order_size = (1 << order);
	while (n != 0) {
c0103431:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0103435:	75 e7                	jne    c010341e <buddy_init_memmap+0x1eb>
			nr_free(order) ++;
		}
		order --;
		order_size >>= 1;
	}
}
c0103437:	83 c4 54             	add    $0x54,%esp
c010343a:	5b                   	pop    %ebx
c010343b:	5d                   	pop    %ebp
c010343c:	c3                   	ret    

c010343d <getorder>:

static inline size_t
getorder(size_t n) {
c010343d:	55                   	push   %ebp
c010343e:	89 e5                	mov    %esp,%ebp
c0103440:	83 ec 28             	sub    $0x28,%esp
	size_t order, order_size;
	for (order = 0, order_size = 1; order <= MAX_ORDER; order ++, order_size <<= 1) {
c0103443:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c010344a:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c0103451:	eb 14                	jmp    c0103467 <getorder+0x2a>
		if (n <= order_size) {
c0103453:	8b 45 08             	mov    0x8(%ebp),%eax
c0103456:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103459:	77 05                	ja     c0103460 <getorder+0x23>
			return order;
c010345b:	8b 45 f4             	mov    -0xc(%ebp),%eax
		}
	}
	panic("getorder failed. %d\n", n);
}
c010345e:	c9                   	leave  
c010345f:	c3                   	ret    
}

static inline size_t
getorder(size_t n) {
	size_t order, order_size;
	for (order = 0, order_size = 1; order <= MAX_ORDER; order ++, order_size <<= 1) {
c0103460:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103464:	d1 65 f0             	shll   -0x10(%ebp)
c0103467:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c010346b:	76 e6                	jbe    c0103453 <getorder+0x16>
		if (n <= order_size) {
			return order;
		}
	}
	panic("getorder failed. %d\n", n);
c010346d:	8b 45 08             	mov    0x8(%ebp),%eax
c0103470:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103474:	c7 44 24 08 6a 7a 10 	movl   $0xc0107a6a,0x8(%esp)
c010347b:	c0 
c010347c:	c7 44 24 04 3d 00 00 	movl   $0x3d,0x4(%esp)
c0103483:	00 
c0103484:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010348b:	e8 74 e1 ff ff       	call   c0101604 <__panic>

c0103490 <buddy_alloc_pages_sub>:
}

/*******************************以下重点***********************************/
static inline struct Page *
buddy_alloc_pages_sub(size_t order) {
c0103490:	55                   	push   %ebp
c0103491:	89 e5                	mov    %esp,%ebp
c0103493:	53                   	push   %ebx
c0103494:	83 ec 74             	sub    $0x74,%esp
	assert(order <= MAX_ORDER);
c0103497:	83 7d 08 0a          	cmpl   $0xa,0x8(%ebp)
c010349b:	76 24                	jbe    c01034c1 <buddy_alloc_pages_sub+0x31>
c010349d:	c7 44 24 0c 7f 7a 10 	movl   $0xc0107a7f,0xc(%esp)
c01034a4:	c0 
c01034a5:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01034ac:	c0 
c01034ad:	c7 44 24 04 43 00 00 	movl   $0x43,0x4(%esp)
c01034b4:	00 
c01034b5:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01034bc:	e8 43 e1 ff ff       	call   c0101604 <__panic>
	size_t cur_order;
	for (cur_order = order; cur_order <= MAX_ORDER; cur_order ++) {
c01034c1:	8b 45 08             	mov    0x8(%ebp),%eax
c01034c4:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01034c7:	e9 b2 01 00 00       	jmp    c010367e <buddy_alloc_pages_sub+0x1ee>
		if (!list_empty(&free_list(cur_order))) {
c01034cc:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01034cf:	89 d0                	mov    %edx,%eax
c01034d1:	01 c0                	add    %eax,%eax
c01034d3:	01 d0                	add    %edx,%eax
c01034d5:	c1 e0 02             	shl    $0x2,%eax
c01034d8:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01034dd:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * list_empty - tests whether a list is empty
 * @list:		the list to test.
 * */
static inline bool
list_empty(list_entry_t *list) {
	return list->next == list;
c01034e0:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01034e3:	8b 40 04             	mov    0x4(%eax),%eax
c01034e6:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c01034e9:	0f 94 c0             	sete   %al
c01034ec:	0f b6 c0             	movzbl %al,%eax
c01034ef:	85 c0                	test   %eax,%eax
c01034f1:	0f 85 83 01 00 00    	jne    c010367a <buddy_alloc_pages_sub+0x1ea>
			list_entry_t *le = list_next(&free_list(cur_order));
c01034f7:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01034fa:	89 d0                	mov    %edx,%eax
c01034fc:	01 c0                	add    %eax,%eax
c01034fe:	01 d0                	add    %edx,%eax
c0103500:	c1 e0 02             	shl    $0x2,%eax
c0103503:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103508:	89 45 dc             	mov    %eax,-0x24(%ebp)
 * list_next - get the next entry
 * @listelm:	the list head
 **/
static list_entry_t *
list_next(list_entry_t *listelm) {
	return listelm->next;
c010350b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010350e:	8b 40 04             	mov    0x4(%eax),%eax
c0103511:	89 45 ec             	mov    %eax,-0x14(%ebp)
			struct Page *page = le2page(le, page_link);
c0103514:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103517:	83 e8 10             	sub    $0x10,%eax
c010351a:	89 45 e8             	mov    %eax,-0x18(%ebp)
			nr_free(cur_order) --;
c010351d:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103520:	89 d0                	mov    %edx,%eax
c0103522:	01 c0                	add    %eax,%eax
c0103524:	01 d0                	add    %edx,%eax
c0103526:	c1 e0 02             	shl    $0x2,%eax
c0103529:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c010352e:	8b 40 08             	mov    0x8(%eax),%eax
c0103531:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0103534:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103537:	89 d0                	mov    %edx,%eax
c0103539:	01 c0                	add    %eax,%eax
c010353b:	01 d0                	add    %edx,%eax
c010353d:	c1 e0 02             	shl    $0x2,%eax
c0103540:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103545:	89 48 08             	mov    %ecx,0x8(%eax)
c0103548:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010354b:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * Note: list_empty() on @listelm does not return true after this, the entry is
 * in an undefined state.
 * */
static inline void
list_del(list_entry_t *listelm) {
	__list_del(listelm->prev, listelm->next);
c010354e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103551:	8b 40 04             	mov    0x4(%eax),%eax
c0103554:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0103557:	8b 12                	mov    (%edx),%edx
c0103559:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010355c:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
	prev->next = next;
c010355f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103562:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0103565:	89 50 04             	mov    %edx,0x4(%eax)
	next->prev = prev;
c0103568:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010356b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010356e:	89 10                	mov    %edx,(%eax)
			list_del(le);
			size_t size = 1 << cur_order;
c0103570:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103573:	ba 01 00 00 00       	mov    $0x1,%edx
c0103578:	89 d3                	mov    %edx,%ebx
c010357a:	89 c1                	mov    %eax,%ecx
c010357c:	d3 e3                	shl    %cl,%ebx
c010357e:	89 d8                	mov    %ebx,%eax
c0103580:	89 45 f0             	mov    %eax,-0x10(%ebp)
			while (cur_order > order) {
c0103583:	e9 c8 00 00 00       	jmp    c0103650 <buddy_alloc_pages_sub+0x1c0>
				cur_order --;
c0103588:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
				size >>= 1;
c010358c:	d1 6d f0             	shrl   -0x10(%ebp)
				struct Page *buddy = page + size;
c010358f:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103592:	89 d0                	mov    %edx,%eax
c0103594:	01 c0                	add    %eax,%eax
c0103596:	01 d0                	add    %edx,%eax
c0103598:	c1 e0 03             	shl    $0x3,%eax
c010359b:	03 45 e8             	add    -0x18(%ebp),%eax
c010359e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
				buddy->property = cur_order;
c01035a1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01035a4:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01035a7:	89 50 08             	mov    %edx,0x8(%eax)
				SetPageProperty(buddy);
c01035aa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01035ad:	83 c0 04             	add    $0x4,%eax
c01035b0:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
c01035b7:	89 45 c8             	mov    %eax,-0x38(%ebp)
c01035ba:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01035bd:	8b 55 cc             	mov    -0x34(%ebp),%edx
c01035c0:	0f ab 10             	bts    %edx,(%eax)
				nr_free(cur_order) ++;
c01035c3:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01035c6:	89 d0                	mov    %edx,%eax
c01035c8:	01 c0                	add    %eax,%eax
c01035ca:	01 d0                	add    %edx,%eax
c01035cc:	c1 e0 02             	shl    $0x2,%eax
c01035cf:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01035d4:	8b 40 08             	mov    0x8(%eax),%eax
c01035d7:	8d 48 01             	lea    0x1(%eax),%ecx
c01035da:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01035dd:	89 d0                	mov    %edx,%eax
c01035df:	01 c0                	add    %eax,%eax
c01035e1:	01 d0                	add    %edx,%eax
c01035e3:	c1 e0 02             	shl    $0x2,%eax
c01035e6:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01035eb:	89 48 08             	mov    %ecx,0x8(%eax)
				list_add(&free_list(cur_order), &(buddy->page_link));
c01035ee:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01035f1:	8d 48 10             	lea    0x10(%eax),%ecx
c01035f4:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01035f7:	89 d0                	mov    %edx,%eax
c01035f9:	01 c0                	add    %eax,%eax
c01035fb:	01 d0                	add    %edx,%eax
c01035fd:	c1 e0 02             	shl    $0x2,%eax
c0103600:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103605:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c0103608:	89 4d c0             	mov    %ecx,-0x40(%ebp)
c010360b:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010360e:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0103611:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0103614:	89 45 b8             	mov    %eax,-0x48(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
	__list_add(elm, listelm, listelm->next);
c0103617:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010361a:	8b 40 04             	mov    0x4(%eax),%eax
c010361d:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0103620:	89 55 b4             	mov    %edx,-0x4c(%ebp)
c0103623:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0103626:	89 55 b0             	mov    %edx,-0x50(%ebp)
c0103629:	89 45 ac             	mov    %eax,-0x54(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
	prev->next = next->prev = elm;
c010362c:	8b 45 ac             	mov    -0x54(%ebp),%eax
c010362f:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0103632:	89 10                	mov    %edx,(%eax)
c0103634:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0103637:	8b 10                	mov    (%eax),%edx
c0103639:	8b 45 b0             	mov    -0x50(%ebp),%eax
c010363c:	89 50 04             	mov    %edx,0x4(%eax)
	elm->next = next;
c010363f:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0103642:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0103645:	89 50 04             	mov    %edx,0x4(%eax)
	elm->prev = prev;
c0103648:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c010364b:	8b 55 b0             	mov    -0x50(%ebp),%edx
c010364e:	89 10                	mov    %edx,(%eax)
			list_entry_t *le = list_next(&free_list(cur_order));
			struct Page *page = le2page(le, page_link);
			nr_free(cur_order) --;
			list_del(le);
			size_t size = 1 << cur_order;
			while (cur_order > order) {
c0103650:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103653:	3b 45 08             	cmp    0x8(%ebp),%eax
c0103656:	0f 87 2c ff ff ff    	ja     c0103588 <buddy_alloc_pages_sub+0xf8>
				buddy->property = cur_order;
				SetPageProperty(buddy);
				nr_free(cur_order) ++;
				list_add(&free_list(cur_order), &(buddy->page_link));
			}
			ClearPageProperty(page);
c010365c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010365f:	83 c0 04             	add    $0x4,%eax
c0103662:	c7 45 a8 01 00 00 00 	movl   $0x1,-0x58(%ebp)
c0103669:	89 45 a4             	mov    %eax,-0x5c(%ebp)
 * @nr:		the bit to clear
 * @addr:	the address to start counting from
 * */
static inline void
clear_bit(int nr, volatile void *addr) {
	asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c010366c:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c010366f:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0103672:	0f b3 10             	btr    %edx,(%eax)
			return page;
c0103675:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103678:	eb 13                	jmp    c010368d <buddy_alloc_pages_sub+0x1fd>
/*******************************以下重点***********************************/
static inline struct Page *
buddy_alloc_pages_sub(size_t order) {
	assert(order <= MAX_ORDER);
	size_t cur_order;
	for (cur_order = order; cur_order <= MAX_ORDER; cur_order ++) {
c010367a:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010367e:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c0103682:	0f 86 44 fe ff ff    	jbe    c01034cc <buddy_alloc_pages_sub+0x3c>
			}
			ClearPageProperty(page);
			return page;
		}
	}
	return NULL;
c0103688:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010368d:	83 c4 74             	add    $0x74,%esp
c0103690:	5b                   	pop    %ebx
c0103691:	5d                   	pop    %ebp
c0103692:	c3                   	ret    

c0103693 <buddy_alloc_pages>:

static struct Page *
buddy_alloc_pages(size_t n) {
c0103693:	55                   	push   %ebp
c0103694:	89 e5                	mov    %esp,%ebp
c0103696:	53                   	push   %ebx
c0103697:	83 ec 24             	sub    $0x24,%esp
	assert(n > 0);
c010369a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010369e:	75 24                	jne    c01036c4 <buddy_alloc_pages+0x31>
c01036a0:	c7 44 24 0c 92 7a 10 	movl   $0xc0107a92,0xc(%esp)
c01036a7:	c0 
c01036a8:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01036af:	c0 
c01036b0:	c7 44 24 04 5e 00 00 	movl   $0x5e,0x4(%esp)
c01036b7:	00 
c01036b8:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01036bf:	e8 40 df ff ff       	call   c0101604 <__panic>
	size_t order = getorder(n), order_size = (1 << order);
c01036c4:	8b 45 08             	mov    0x8(%ebp),%eax
c01036c7:	89 04 24             	mov    %eax,(%esp)
c01036ca:	e8 6e fd ff ff       	call   c010343d <getorder>
c01036cf:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01036d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01036d5:	ba 01 00 00 00       	mov    $0x1,%edx
c01036da:	89 d3                	mov    %edx,%ebx
c01036dc:	89 c1                	mov    %eax,%ecx
c01036de:	d3 e3                	shl    %cl,%ebx
c01036e0:	89 d8                	mov    %ebx,%eax
c01036e2:	89 45 f0             	mov    %eax,-0x10(%ebp)
	struct Page *page = buddy_alloc_pages_sub(order);
c01036e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01036e8:	89 04 24             	mov    %eax,(%esp)
c01036eb:	e8 a0 fd ff ff       	call   c0103490 <buddy_alloc_pages_sub>
c01036f0:	89 45 ec             	mov    %eax,-0x14(%ebp)
	if (page != NULL && n != order_size) {
c01036f3:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01036f7:	74 2d                	je     c0103726 <buddy_alloc_pages+0x93>
c01036f9:	8b 45 08             	mov    0x8(%ebp),%eax
c01036fc:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c01036ff:	74 25                	je     c0103726 <buddy_alloc_pages+0x93>
		free_pages(page + n, order_size - n);
c0103701:	8b 45 08             	mov    0x8(%ebp),%eax
c0103704:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103707:	89 d1                	mov    %edx,%ecx
c0103709:	29 c1                	sub    %eax,%ecx
c010370b:	8b 55 08             	mov    0x8(%ebp),%edx
c010370e:	89 d0                	mov    %edx,%eax
c0103710:	01 c0                	add    %eax,%eax
c0103712:	01 d0                	add    %edx,%eax
c0103714:	c1 e0 03             	shl    $0x3,%eax
c0103717:	03 45 ec             	add    -0x14(%ebp),%eax
c010371a:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c010371e:	89 04 24             	mov    %eax,(%esp)
c0103721:	e8 fd 12 00 00       	call   c0104a23 <free_pages>
	}
	return page;
c0103726:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
c0103729:	83 c4 24             	add    $0x24,%esp
c010372c:	5b                   	pop    %ebx
c010372d:	5d                   	pop    %ebp
c010372e:	c3                   	ret    

c010372f <page_is_buddy>:
/*******************************以上重点*************************************/

static inline bool
page_is_buddy(struct Page *page, size_t order, int zone_num) {
c010372f:	55                   	push   %ebp
c0103730:	89 e5                	mov    %esp,%ebp
c0103732:	53                   	push   %ebx
c0103733:	83 ec 24             	sub    $0x24,%esp
	if (page2ppn(page) < npage) {
c0103736:	8b 45 08             	mov    0x8(%ebp),%eax
c0103739:	89 04 24             	mov    %eax,(%esp)
c010373c:	e8 5f fa ff ff       	call   c01031a0 <page2ppn>
c0103741:	8b 15 00 ba 11 c0    	mov    0xc011ba00,%edx
c0103747:	39 d0                	cmp    %edx,%eax
c0103749:	73 7c                	jae    c01037c7 <page_is_buddy+0x98>
		if (page->zone_num == zone_num) {
c010374b:	8b 45 08             	mov    0x8(%ebp),%eax
c010374e:	8b 40 0c             	mov    0xc(%eax),%eax
c0103751:	3b 45 10             	cmp    0x10(%ebp),%eax
c0103754:	75 71                	jne    c01037c7 <page_is_buddy+0x98>
			return !PageReserved(page) && PageProperty(page) && page->property == order;
c0103756:	8b 45 08             	mov    0x8(%ebp),%eax
c0103759:	83 c0 04             	add    $0x4,%eax
c010375c:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c0103763:	89 45 f4             	mov    %eax,-0xc(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103766:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103769:	8b 55 f8             	mov    -0x8(%ebp),%edx
c010376c:	0f a3 10             	bt     %edx,(%eax)
c010376f:	19 db                	sbb    %ebx,%ebx
c0103771:	89 5d f0             	mov    %ebx,-0x10(%ebp)
	return oldbit != 0;
c0103774:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0103778:	0f 95 c0             	setne  %al
c010377b:	0f b6 c0             	movzbl %al,%eax
c010377e:	85 c0                	test   %eax,%eax
c0103780:	75 3e                	jne    c01037c0 <page_is_buddy+0x91>
c0103782:	8b 45 08             	mov    0x8(%ebp),%eax
c0103785:	83 c0 04             	add    $0x4,%eax
c0103788:	c7 45 ec 01 00 00 00 	movl   $0x1,-0x14(%ebp)
c010378f:	89 45 e8             	mov    %eax,-0x18(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103792:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103795:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0103798:	0f a3 10             	bt     %edx,(%eax)
c010379b:	19 db                	sbb    %ebx,%ebx
c010379d:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
	return oldbit != 0;
c01037a0:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01037a4:	0f 95 c0             	setne  %al
c01037a7:	0f b6 c0             	movzbl %al,%eax
c01037aa:	85 c0                	test   %eax,%eax
c01037ac:	74 12                	je     c01037c0 <page_is_buddy+0x91>
c01037ae:	8b 45 08             	mov    0x8(%ebp),%eax
c01037b1:	8b 40 08             	mov    0x8(%eax),%eax
c01037b4:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01037b7:	75 07                	jne    c01037c0 <page_is_buddy+0x91>
c01037b9:	b8 01 00 00 00       	mov    $0x1,%eax
c01037be:	eb 05                	jmp    c01037c5 <page_is_buddy+0x96>
c01037c0:	b8 00 00 00 00       	mov    $0x0,%eax
c01037c5:	eb 05                	jmp    c01037cc <page_is_buddy+0x9d>
		}
	}
	return 0;
c01037c7:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01037cc:	83 c4 24             	add    $0x24,%esp
c01037cf:	5b                   	pop    %ebx
c01037d0:	5d                   	pop    %ebp
c01037d1:	c3                   	ret    

c01037d2 <page2idx>:

static inline ppn_t
page2idx(struct Page *page) {
c01037d2:	55                   	push   %ebp
c01037d3:	89 e5                	mov    %esp,%ebp
	return page - zones[page->zone_num].mem_base;
c01037d5:	8b 55 08             	mov    0x8(%ebp),%edx
c01037d8:	8b 45 08             	mov    0x8(%ebp),%eax
c01037db:	8b 40 0c             	mov    0xc(%eax),%eax
c01037de:	8b 04 85 20 b9 11 c0 	mov    -0x3fee46e0(,%eax,4),%eax
c01037e5:	89 d1                	mov    %edx,%ecx
c01037e7:	29 c1                	sub    %eax,%ecx
c01037e9:	89 c8                	mov    %ecx,%eax
c01037eb:	c1 f8 03             	sar    $0x3,%eax
c01037ee:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
}
c01037f4:	5d                   	pop    %ebp
c01037f5:	c3                   	ret    

c01037f6 <idx2page>:

static inline struct Page *
idx2page(int zone_num, ppn_t idx) {
c01037f6:	55                   	push   %ebp
c01037f7:	89 e5                	mov    %esp,%ebp
	return zones[zone_num].mem_base + idx;
c01037f9:	8b 45 08             	mov    0x8(%ebp),%eax
c01037fc:	8b 0c 85 20 b9 11 c0 	mov    -0x3fee46e0(,%eax,4),%ecx
c0103803:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103806:	89 d0                	mov    %edx,%eax
c0103808:	01 c0                	add    %eax,%eax
c010380a:	01 d0                	add    %edx,%eax
c010380c:	c1 e0 03             	shl    $0x3,%eax
c010380f:	8d 04 01             	lea    (%ecx,%eax,1),%eax
}
c0103812:	5d                   	pop    %ebp
c0103813:	c3                   	ret    

c0103814 <buddy_free_pages_sub>:

/******************************以下重点*******************************/
static void
buddy_free_pages_sub(struct Page *base, size_t order) {
c0103814:	55                   	push   %ebp
c0103815:	89 e5                	mov    %esp,%ebp
c0103817:	53                   	push   %ebx
c0103818:	81 ec 84 00 00 00    	sub    $0x84,%esp
	ppn_t buddy_idx, page_idx = page2idx(base);
c010381e:	8b 45 08             	mov    0x8(%ebp),%eax
c0103821:	89 04 24             	mov    %eax,(%esp)
c0103824:	e8 a9 ff ff ff       	call   c01037d2 <page2idx>
c0103829:	89 45 f4             	mov    %eax,-0xc(%ebp)
	assert((page_idx & ((1 << order) - 1)) == 0);
c010382c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010382f:	ba 01 00 00 00       	mov    $0x1,%edx
c0103834:	89 d3                	mov    %edx,%ebx
c0103836:	89 c1                	mov    %eax,%ecx
c0103838:	d3 e3                	shl    %cl,%ebx
c010383a:	89 d8                	mov    %ebx,%eax
c010383c:	83 e8 01             	sub    $0x1,%eax
c010383f:	23 45 f4             	and    -0xc(%ebp),%eax
c0103842:	85 c0                	test   %eax,%eax
c0103844:	74 24                	je     c010386a <buddy_free_pages_sub+0x56>
c0103846:	c7 44 24 0c 98 7a 10 	movl   $0xc0107a98,0xc(%esp)
c010384d:	c0 
c010384e:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103855:	c0 
c0103856:	c7 44 24 04 80 00 00 	movl   $0x80,0x4(%esp)
c010385d:	00 
c010385e:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103865:	e8 9a dd ff ff       	call   c0101604 <__panic>
	struct Page *p = base;
c010386a:	8b 45 08             	mov    0x8(%ebp),%eax
c010386d:	89 45 f0             	mov    %eax,-0x10(%ebp)
	for (; p != base + (1 << order); p ++) {
c0103870:	e9 9d 00 00 00       	jmp    c0103912 <buddy_free_pages_sub+0xfe>
		assert(!PageReserved(p) && !PageProperty(p));
c0103875:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103878:	83 c0 04             	add    $0x4,%eax
c010387b:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0103882:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103885:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103888:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010388b:	0f a3 10             	bt     %edx,(%eax)
c010388e:	19 db                	sbb    %ebx,%ebx
c0103890:	89 5d d4             	mov    %ebx,-0x2c(%ebp)
	return oldbit != 0;
c0103893:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
c0103897:	0f 95 c0             	setne  %al
c010389a:	0f b6 c0             	movzbl %al,%eax
c010389d:	85 c0                	test   %eax,%eax
c010389f:	75 2c                	jne    c01038cd <buddy_free_pages_sub+0xb9>
c01038a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01038a4:	83 c0 04             	add    $0x4,%eax
c01038a7:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c01038ae:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01038b1:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01038b4:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01038b7:	0f a3 10             	bt     %edx,(%eax)
c01038ba:	19 db                	sbb    %ebx,%ebx
c01038bc:	89 5d c8             	mov    %ebx,-0x38(%ebp)
	return oldbit != 0;
c01038bf:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c01038c3:	0f 95 c0             	setne  %al
c01038c6:	0f b6 c0             	movzbl %al,%eax
c01038c9:	85 c0                	test   %eax,%eax
c01038cb:	74 24                	je     c01038f1 <buddy_free_pages_sub+0xdd>
c01038cd:	c7 44 24 0c c0 7a 10 	movl   $0xc0107ac0,0xc(%esp)
c01038d4:	c0 
c01038d5:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01038dc:	c0 
c01038dd:	c7 44 24 04 83 00 00 	movl   $0x83,0x4(%esp)
c01038e4:	00 
c01038e5:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01038ec:	e8 13 dd ff ff       	call   c0101604 <__panic>
		p->flags = 0;
c01038f1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01038f4:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
		set_page_ref(p, 0);
c01038fb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0103902:	00 
c0103903:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103906:	89 04 24             	mov    %eax,(%esp)
c0103909:	e8 ae f8 ff ff       	call   c01031bc <set_page_ref>
static void
buddy_free_pages_sub(struct Page *base, size_t order) {
	ppn_t buddy_idx, page_idx = page2idx(base);
	assert((page_idx & ((1 << order) - 1)) == 0);
	struct Page *p = base;
	for (; p != base + (1 << order); p ++) {
c010390e:	83 45 f0 18          	addl   $0x18,-0x10(%ebp)
c0103912:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103915:	ba 18 00 00 00       	mov    $0x18,%edx
c010391a:	89 d3                	mov    %edx,%ebx
c010391c:	89 c1                	mov    %eax,%ecx
c010391e:	d3 e3                	shl    %cl,%ebx
c0103920:	89 d8                	mov    %ebx,%eax
c0103922:	03 45 08             	add    0x8(%ebp),%eax
c0103925:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103928:	0f 85 47 ff ff ff    	jne    c0103875 <buddy_free_pages_sub+0x61>
		assert(!PageReserved(p) && !PageProperty(p));
		p->flags = 0;
		set_page_ref(p, 0);
	}
	int zone_num = base->zone_num;
c010392e:	8b 45 08             	mov    0x8(%ebp),%eax
c0103931:	8b 40 0c             	mov    0xc(%eax),%eax
c0103934:	89 45 ec             	mov    %eax,-0x14(%ebp)
	 * you need to clear properties after removing buddies
	 * and don't forget to add the final buddy and set properties
	 *
	 * Task4
	 */
	while (order < MAX_ORDER) {
c0103937:	e9 c5 00 00 00       	jmp    c0103a01 <buddy_free_pages_sub+0x1ed>
		//Get the Buddy Index
		buddy_idx = page_idx ^ (1 << order);
c010393c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010393f:	ba 01 00 00 00       	mov    $0x1,%edx
c0103944:	89 d3                	mov    %edx,%ebx
c0103946:	89 c1                	mov    %eax,%ecx
c0103948:	d3 e3                	shl    %cl,%ebx
c010394a:	89 d8                	mov    %ebx,%eax
c010394c:	33 45 f4             	xor    -0xc(%ebp),%eax
c010394f:	89 45 e8             	mov    %eax,-0x18(%ebp)
		//Get Buddy
		struct Page *buddy = idx2page(zone_num, buddy_idx);
c0103952:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103955:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103959:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010395c:	89 04 24             	mov    %eax,(%esp)
c010395f:	e8 92 fe ff ff       	call   c01037f6 <idx2page>
c0103964:	89 45 e4             	mov    %eax,-0x1c(%ebp)
		if (!page_is_buddy(buddy, order, zone_num)) break;
c0103967:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010396a:	89 44 24 08          	mov    %eax,0x8(%esp)
c010396e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103971:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103975:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103978:	89 04 24             	mov    %eax,(%esp)
c010397b:	e8 af fd ff ff       	call   c010372f <page_is_buddy>
c0103980:	85 c0                	test   %eax,%eax
c0103982:	0f 84 85 00 00 00    	je     c0103a0d <buddy_free_pages_sub+0x1f9>
		
		//Free the Buddy
		nr_free(order)--;
c0103988:	8b 55 0c             	mov    0xc(%ebp),%edx
c010398b:	89 d0                	mov    %edx,%eax
c010398d:	01 c0                	add    %eax,%eax
c010398f:	01 d0                	add    %edx,%eax
c0103991:	c1 e0 02             	shl    $0x2,%eax
c0103994:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103999:	8b 40 08             	mov    0x8(%eax),%eax
c010399c:	8d 48 ff             	lea    -0x1(%eax),%ecx
c010399f:	8b 55 0c             	mov    0xc(%ebp),%edx
c01039a2:	89 d0                	mov    %edx,%eax
c01039a4:	01 c0                	add    %eax,%eax
c01039a6:	01 d0                	add    %edx,%eax
c01039a8:	c1 e0 02             	shl    $0x2,%eax
c01039ab:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01039b0:	89 48 08             	mov    %ecx,0x8(%eax)
		list_del(&(buddy->page_link));
c01039b3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01039b6:	83 c0 10             	add    $0x10,%eax
c01039b9:	89 45 c4             	mov    %eax,-0x3c(%ebp)
 * Note: list_empty() on @listelm does not return true after this, the entry is
 * in an undefined state.
 * */
static inline void
list_del(list_entry_t *listelm) {
	__list_del(listelm->prev, listelm->next);
c01039bc:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01039bf:	8b 40 04             	mov    0x4(%eax),%eax
c01039c2:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01039c5:	8b 12                	mov    (%edx),%edx
c01039c7:	89 55 c0             	mov    %edx,-0x40(%ebp)
c01039ca:	89 45 bc             	mov    %eax,-0x44(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
	prev->next = next;
c01039cd:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01039d0:	8b 55 bc             	mov    -0x44(%ebp),%edx
c01039d3:	89 50 04             	mov    %edx,0x4(%eax)
	next->prev = prev;
c01039d6:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01039d9:	8b 55 c0             	mov    -0x40(%ebp),%edx
c01039dc:	89 10                	mov    %edx,(%eax)
		ClearPageProperty(buddy);
c01039de:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01039e1:	83 c0 04             	add    $0x4,%eax
c01039e4:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c01039eb:	89 45 b4             	mov    %eax,-0x4c(%ebp)
 * @nr:		the bit to clear
 * @addr:	the address to start counting from
 * */
static inline void
clear_bit(int nr, volatile void *addr) {
	asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01039ee:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01039f1:	8b 55 b8             	mov    -0x48(%ebp),%edx
c01039f4:	0f b3 10             	btr    %edx,(%eax)
		page_idx &= buddy_idx;
c01039f7:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039fa:	21 45 f4             	and    %eax,-0xc(%ebp)
		order++;
c01039fd:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
	 * you need to clear properties after removing buddies
	 * and don't forget to add the final buddy and set properties
	 *
	 * Task4
	 */
	while (order < MAX_ORDER) {
c0103a01:	83 7d 0c 09          	cmpl   $0x9,0xc(%ebp)
c0103a05:	0f 86 31 ff ff ff    	jbe    c010393c <buddy_free_pages_sub+0x128>
c0103a0b:	eb 01                	jmp    c0103a0e <buddy_free_pages_sub+0x1fa>
		//Get the Buddy Index
		buddy_idx = page_idx ^ (1 << order);
		//Get Buddy
		struct Page *buddy = idx2page(zone_num, buddy_idx);
		if (!page_is_buddy(buddy, order, zone_num)) break;
c0103a0d:	90                   	nop
		ClearPageProperty(buddy);
		page_idx &= buddy_idx;
		order++;
	}
	//Add the last one
	struct Page *page = idx2page(zone_num, page_idx);
c0103a0e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103a11:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103a15:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103a18:	89 04 24             	mov    %eax,(%esp)
c0103a1b:	e8 d6 fd ff ff       	call   c01037f6 <idx2page>
c0103a20:	89 45 e0             	mov    %eax,-0x20(%ebp)
	page->property = order;
c0103a23:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103a26:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103a29:	89 50 08             	mov    %edx,0x8(%eax)
	SetPageProperty(page);
c0103a2c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103a2f:	83 c0 04             	add    $0x4,%eax
c0103a32:	c7 45 b0 01 00 00 00 	movl   $0x1,-0x50(%ebp)
c0103a39:	89 45 ac             	mov    %eax,-0x54(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
	asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0103a3c:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0103a3f:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0103a42:	0f ab 10             	bts    %edx,(%eax)
	nr_free(order)++;
c0103a45:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103a48:	89 d0                	mov    %edx,%eax
c0103a4a:	01 c0                	add    %eax,%eax
c0103a4c:	01 d0                	add    %edx,%eax
c0103a4e:	c1 e0 02             	shl    $0x2,%eax
c0103a51:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103a56:	8b 40 08             	mov    0x8(%eax),%eax
c0103a59:	8d 48 01             	lea    0x1(%eax),%ecx
c0103a5c:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103a5f:	89 d0                	mov    %edx,%eax
c0103a61:	01 c0                	add    %eax,%eax
c0103a63:	01 d0                	add    %edx,%eax
c0103a65:	c1 e0 02             	shl    $0x2,%eax
c0103a68:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103a6d:	89 48 08             	mov    %ecx,0x8(%eax)
	list_add(&free_list(order), &(page->page_link));	 
c0103a70:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103a73:	8d 48 10             	lea    0x10(%eax),%ecx
c0103a76:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103a79:	89 d0                	mov    %edx,%eax
c0103a7b:	01 c0                	add    %eax,%eax
c0103a7d:	01 d0                	add    %edx,%eax
c0103a7f:	c1 e0 02             	shl    $0x2,%eax
c0103a82:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103a87:	89 45 a8             	mov    %eax,-0x58(%ebp)
c0103a8a:	89 4d a4             	mov    %ecx,-0x5c(%ebp)
c0103a8d:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103a90:	89 45 a0             	mov    %eax,-0x60(%ebp)
c0103a93:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0103a96:	89 45 9c             	mov    %eax,-0x64(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
	__list_add(elm, listelm, listelm->next);
c0103a99:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0103a9c:	8b 40 04             	mov    0x4(%eax),%eax
c0103a9f:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0103aa2:	89 55 98             	mov    %edx,-0x68(%ebp)
c0103aa5:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0103aa8:	89 55 94             	mov    %edx,-0x6c(%ebp)
c0103aab:	89 45 90             	mov    %eax,-0x70(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
	prev->next = next->prev = elm;
c0103aae:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103ab1:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103ab4:	89 10                	mov    %edx,(%eax)
c0103ab6:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103ab9:	8b 10                	mov    (%eax),%edx
c0103abb:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0103abe:	89 50 04             	mov    %edx,0x4(%eax)
	elm->next = next;
c0103ac1:	8b 45 98             	mov    -0x68(%ebp),%eax
c0103ac4:	8b 55 90             	mov    -0x70(%ebp),%edx
c0103ac7:	89 50 04             	mov    %edx,0x4(%eax)
	elm->prev = prev;
c0103aca:	8b 45 98             	mov    -0x68(%ebp),%eax
c0103acd:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0103ad0:	89 10                	mov    %edx,(%eax)
}
c0103ad2:	81 c4 84 00 00 00    	add    $0x84,%esp
c0103ad8:	5b                   	pop    %ebx
c0103ad9:	5d                   	pop    %ebp
c0103ada:	c3                   	ret    

c0103adb <buddy_free_pages>:

static void
buddy_free_pages(struct Page *base, size_t n) {
c0103adb:	55                   	push   %ebp
c0103adc:	89 e5                	mov    %esp,%ebp
c0103ade:	83 ec 28             	sub    $0x28,%esp
	assert(n > 0);
c0103ae1:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0103ae5:	75 24                	jne    c0103b0b <buddy_free_pages+0x30>
c0103ae7:	c7 44 24 0c 92 7a 10 	movl   $0xc0107a92,0xc(%esp)
c0103aee:	c0 
c0103aef:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103af6:	c0 
c0103af7:	c7 44 24 04 aa 00 00 	movl   $0xaa,0x4(%esp)
c0103afe:	00 
c0103aff:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103b06:	e8 f9 da ff ff       	call   c0101604 <__panic>
	if (n == 1) {
c0103b0b:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0103b0f:	75 18                	jne    c0103b29 <buddy_free_pages+0x4e>
		buddy_free_pages_sub(base, 0);
c0103b11:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0103b18:	00 
c0103b19:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b1c:	89 04 24             	mov    %eax,(%esp)
c0103b1f:	e8 f0 fc ff ff       	call   c0103814 <buddy_free_pages_sub>
c0103b24:	e9 c0 00 00 00       	jmp    c0103be9 <buddy_free_pages+0x10e>
	}
	else {
		size_t order = 0, order_size = 1;
c0103b29:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103b30:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
		while (n >= order_size) {
c0103b37:	eb 6a                	jmp    c0103ba3 <buddy_free_pages+0xc8>
			assert(order <= MAX_ORDER);
c0103b39:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c0103b3d:	76 24                	jbe    c0103b63 <buddy_free_pages+0x88>
c0103b3f:	c7 44 24 0c 7f 7a 10 	movl   $0xc0107a7f,0xc(%esp)
c0103b46:	c0 
c0103b47:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103b4e:	c0 
c0103b4f:	c7 44 24 04 b1 00 00 	movl   $0xb1,0x4(%esp)
c0103b56:	00 
c0103b57:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103b5e:	e8 a1 da ff ff       	call   c0101604 <__panic>
			if ((page2idx(base) & order_size) != 0) {
c0103b63:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b66:	89 04 24             	mov    %eax,(%esp)
c0103b69:	e8 64 fc ff ff       	call   c01037d2 <page2idx>
c0103b6e:	23 45 f0             	and    -0x10(%ebp),%eax
c0103b71:	85 c0                	test   %eax,%eax
c0103b73:	74 27                	je     c0103b9c <buddy_free_pages+0xc1>
				buddy_free_pages_sub(base, order);
c0103b75:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b78:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103b7c:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b7f:	89 04 24             	mov    %eax,(%esp)
c0103b82:	e8 8d fc ff ff       	call   c0103814 <buddy_free_pages_sub>
				base += order_size;
c0103b87:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103b8a:	89 d0                	mov    %edx,%eax
c0103b8c:	01 c0                	add    %eax,%eax
c0103b8e:	01 d0                	add    %edx,%eax
c0103b90:	c1 e0 03             	shl    $0x3,%eax
c0103b93:	01 45 08             	add    %eax,0x8(%ebp)
				n -= order_size;
c0103b96:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103b99:	29 45 0c             	sub    %eax,0xc(%ebp)
			}
			order ++;
c0103b9c:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
			order_size <<= 1;
c0103ba0:	d1 65 f0             	shll   -0x10(%ebp)
	if (n == 1) {
		buddy_free_pages_sub(base, 0);
	}
	else {
		size_t order = 0, order_size = 1;
		while (n >= order_size) {
c0103ba3:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103ba6:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103ba9:	73 8e                	jae    c0103b39 <buddy_free_pages+0x5e>
				n -= order_size;
			}
			order ++;
			order_size <<= 1;
		}
		while (n != 0) {
c0103bab:	eb 36                	jmp    c0103be3 <buddy_free_pages+0x108>
			while (n < order_size) {
				order --;
c0103bad:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
				order_size >>= 1;
c0103bb1:	d1 6d f0             	shrl   -0x10(%ebp)
			}
			order ++;
			order_size <<= 1;
		}
		while (n != 0) {
			while (n < order_size) {
c0103bb4:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103bb7:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103bba:	72 f1                	jb     c0103bad <buddy_free_pages+0xd2>
				order --;
				order_size >>= 1;
			}
			buddy_free_pages_sub(base, order);
c0103bbc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103bbf:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103bc3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bc6:	89 04 24             	mov    %eax,(%esp)
c0103bc9:	e8 46 fc ff ff       	call   c0103814 <buddy_free_pages_sub>
			base += order_size;
c0103bce:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103bd1:	89 d0                	mov    %edx,%eax
c0103bd3:	01 c0                	add    %eax,%eax
c0103bd5:	01 d0                	add    %edx,%eax
c0103bd7:	c1 e0 03             	shl    $0x3,%eax
c0103bda:	01 45 08             	add    %eax,0x8(%ebp)
			n -= order_size;
c0103bdd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103be0:	29 45 0c             	sub    %eax,0xc(%ebp)
				n -= order_size;
			}
			order ++;
			order_size <<= 1;
		}
		while (n != 0) {
c0103be3:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0103be7:	75 cb                	jne    c0103bb4 <buddy_free_pages+0xd9>
			buddy_free_pages_sub(base, order);
			base += order_size;
			n -= order_size;
		}
	}
}
c0103be9:	c9                   	leave  
c0103bea:	c3                   	ret    

c0103beb <buddy_nr_free_pages>:
/******************************以上重点*******************************/

static size_t
buddy_nr_free_pages(void) {
c0103beb:	55                   	push   %ebp
c0103bec:	89 e5                	mov    %esp,%ebp
c0103bee:	53                   	push   %ebx
c0103bef:	83 ec 10             	sub    $0x10,%esp
	size_t ret = 0, order = 0;
c0103bf2:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c0103bf9:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	for (; order <= MAX_ORDER; order ++) {
c0103c00:	eb 26                	jmp    c0103c28 <buddy_nr_free_pages+0x3d>
		ret += nr_free(order) * (1 << order);
c0103c02:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103c05:	89 d0                	mov    %edx,%eax
c0103c07:	01 c0                	add    %eax,%eax
c0103c09:	01 d0                	add    %edx,%eax
c0103c0b:	c1 e0 02             	shl    $0x2,%eax
c0103c0e:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103c13:	8b 50 08             	mov    0x8(%eax),%edx
c0103c16:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103c19:	89 d3                	mov    %edx,%ebx
c0103c1b:	89 c1                	mov    %eax,%ecx
c0103c1d:	d3 e3                	shl    %cl,%ebx
c0103c1f:	89 d8                	mov    %ebx,%eax
c0103c21:	01 45 f8             	add    %eax,-0x8(%ebp)
/******************************以上重点*******************************/

static size_t
buddy_nr_free_pages(void) {
	size_t ret = 0, order = 0;
	for (; order <= MAX_ORDER; order ++) {
c0103c24:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103c28:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c0103c2c:	76 d4                	jbe    c0103c02 <buddy_nr_free_pages+0x17>
		ret += nr_free(order) * (1 << order);
	}
	return ret;
c0103c2e:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0103c31:	83 c4 10             	add    $0x10,%esp
c0103c34:	5b                   	pop    %ebx
c0103c35:	5d                   	pop    %ebp
c0103c36:	c3                   	ret    

c0103c37 <buddy_check>:

static void
buddy_check(void) {
c0103c37:	55                   	push   %ebp
c0103c38:	89 e5                	mov    %esp,%ebp
c0103c3a:	53                   	push   %ebx
c0103c3b:	81 ec 54 01 00 00    	sub    $0x154,%esp
	int i;
	int count = 0, total = 0;
c0103c41:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0103c48:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
	for (i = 0; i <= MAX_ORDER; i ++) {
c0103c4f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103c56:	e9 b8 00 00 00       	jmp    c0103d13 <buddy_check+0xdc>
		list_entry_t *list = &free_list(i), *le = list;
c0103c5b:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103c5e:	89 d0                	mov    %edx,%eax
c0103c60:	01 c0                	add    %eax,%eax
c0103c62:	01 d0                	add    %edx,%eax
c0103c64:	c1 e0 02             	shl    $0x2,%eax
c0103c67:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103c6c:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103c6f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103c72:	89 45 e8             	mov    %eax,-0x18(%ebp)
		while ((le = list_next(le)) != list) {
c0103c75:	eb 7d                	jmp    c0103cf4 <buddy_check+0xbd>
			struct Page *p = le2page(le, page_link);
c0103c77:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103c7a:	83 e8 10             	sub    $0x10,%eax
c0103c7d:	89 45 dc             	mov    %eax,-0x24(%ebp)
			assert(PageProperty(p) && p->property == i);
c0103c80:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103c83:	83 c0 04             	add    $0x4,%eax
c0103c86:	c7 45 c4 01 00 00 00 	movl   $0x1,-0x3c(%ebp)
c0103c8d:	89 45 c0             	mov    %eax,-0x40(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103c90:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0103c93:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0103c96:	0f a3 10             	bt     %edx,(%eax)
c0103c99:	19 db                	sbb    %ebx,%ebx
c0103c9b:	89 5d bc             	mov    %ebx,-0x44(%ebp)
	return oldbit != 0;
c0103c9e:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
c0103ca2:	0f 95 c0             	setne  %al
c0103ca5:	0f b6 c0             	movzbl %al,%eax
c0103ca8:	85 c0                	test   %eax,%eax
c0103caa:	74 0d                	je     c0103cb9 <buddy_check+0x82>
c0103cac:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103caf:	8b 50 08             	mov    0x8(%eax),%edx
c0103cb2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103cb5:	39 c2                	cmp    %eax,%edx
c0103cb7:	74 24                	je     c0103cdd <buddy_check+0xa6>
c0103cb9:	c7 44 24 0c e8 7a 10 	movl   $0xc0107ae8,0xc(%esp)
c0103cc0:	c0 
c0103cc1:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103cc8:	c0 
c0103cc9:	c7 44 24 04 d8 00 00 	movl   $0xd8,0x4(%esp)
c0103cd0:	00 
c0103cd1:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103cd8:	e8 27 d9 ff ff       	call   c0101604 <__panic>
			count ++, total += (1 << i);
c0103cdd:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
c0103ce1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103ce4:	ba 01 00 00 00       	mov    $0x1,%edx
c0103ce9:	89 d3                	mov    %edx,%ebx
c0103ceb:	89 c1                	mov    %eax,%ecx
c0103ced:	d3 e3                	shl    %cl,%ebx
c0103cef:	89 d8                	mov    %ebx,%eax
c0103cf1:	01 45 ec             	add    %eax,-0x14(%ebp)
c0103cf4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103cf7:	89 45 b8             	mov    %eax,-0x48(%ebp)
 * list_next - get the next entry
 * @listelm:	the list head
 **/
static list_entry_t *
list_next(list_entry_t *listelm) {
	return listelm->next;
c0103cfa:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0103cfd:	8b 40 04             	mov    0x4(%eax),%eax
buddy_check(void) {
	int i;
	int count = 0, total = 0;
	for (i = 0; i <= MAX_ORDER; i ++) {
		list_entry_t *list = &free_list(i), *le = list;
		while ((le = list_next(le)) != list) {
c0103d00:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103d03:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103d06:	3b 45 e0             	cmp    -0x20(%ebp),%eax
c0103d09:	0f 85 68 ff ff ff    	jne    c0103c77 <buddy_check+0x40>

static void
buddy_check(void) {
	int i;
	int count = 0, total = 0;
	for (i = 0; i <= MAX_ORDER; i ++) {
c0103d0f:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103d13:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c0103d17:	0f 8e 3e ff ff ff    	jle    c0103c5b <buddy_check+0x24>
			struct Page *p = le2page(le, page_link);
			assert(PageProperty(p) && p->property == i);
			count ++, total += (1 << i);
		}
	}
	assert(total == nr_free_pages());
c0103d1d:	8b 5d ec             	mov    -0x14(%ebp),%ebx
c0103d20:	e8 30 0d 00 00       	call   c0104a55 <nr_free_pages>
c0103d25:	39 c3                	cmp    %eax,%ebx
c0103d27:	74 24                	je     c0103d4d <buddy_check+0x116>
c0103d29:	c7 44 24 0c 0c 7b 10 	movl   $0xc0107b0c,0xc(%esp)
c0103d30:	c0 
c0103d31:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103d38:	c0 
c0103d39:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
c0103d40:	00 
c0103d41:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103d48:	e8 b7 d8 ff ff       	call   c0101604 <__panic>

	struct Page *p0 = alloc_pages(8), *buddy = alloc_pages(8), *p1;
c0103d4d:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0103d54:	e8 99 0c 00 00       	call   c01049f2 <alloc_pages>
c0103d59:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0103d5c:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0103d63:	e8 8a 0c 00 00       	call   c01049f2 <alloc_pages>
c0103d68:	89 45 d4             	mov    %eax,-0x2c(%ebp)

	assert(p0 != NULL);
c0103d6b:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0103d6f:	75 24                	jne    c0103d95 <buddy_check+0x15e>
c0103d71:	c7 44 24 0c 25 7b 10 	movl   $0xc0107b25,0xc(%esp)
c0103d78:	c0 
c0103d79:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103d80:	c0 
c0103d81:	c7 44 24 04 e0 00 00 	movl   $0xe0,0x4(%esp)
c0103d88:	00 
c0103d89:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103d90:	e8 6f d8 ff ff       	call   c0101604 <__panic>
	assert((page2idx(p0) & 7) == 0);
c0103d95:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103d98:	89 04 24             	mov    %eax,(%esp)
c0103d9b:	e8 32 fa ff ff       	call   c01037d2 <page2idx>
c0103da0:	83 e0 07             	and    $0x7,%eax
c0103da3:	85 c0                	test   %eax,%eax
c0103da5:	74 24                	je     c0103dcb <buddy_check+0x194>
c0103da7:	c7 44 24 0c 30 7b 10 	movl   $0xc0107b30,0xc(%esp)
c0103dae:	c0 
c0103daf:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103db6:	c0 
c0103db7:	c7 44 24 04 e1 00 00 	movl   $0xe1,0x4(%esp)
c0103dbe:	00 
c0103dbf:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103dc6:	e8 39 d8 ff ff       	call   c0101604 <__panic>
	assert(!PageProperty(p0));
c0103dcb:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103dce:	83 c0 04             	add    $0x4,%eax
c0103dd1:	c7 45 b4 01 00 00 00 	movl   $0x1,-0x4c(%ebp)
c0103dd8:	89 45 b0             	mov    %eax,-0x50(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103ddb:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0103dde:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0103de1:	0f a3 10             	bt     %edx,(%eax)
c0103de4:	19 db                	sbb    %ebx,%ebx
c0103de6:	89 5d ac             	mov    %ebx,-0x54(%ebp)
	return oldbit != 0;
c0103de9:	83 7d ac 00          	cmpl   $0x0,-0x54(%ebp)
c0103ded:	0f 95 c0             	setne  %al
c0103df0:	0f b6 c0             	movzbl %al,%eax
c0103df3:	85 c0                	test   %eax,%eax
c0103df5:	74 24                	je     c0103e1b <buddy_check+0x1e4>
c0103df7:	c7 44 24 0c 48 7b 10 	movl   $0xc0107b48,0xc(%esp)
c0103dfe:	c0 
c0103dff:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103e06:	c0 
c0103e07:	c7 44 24 04 e2 00 00 	movl   $0xe2,0x4(%esp)
c0103e0e:	00 
c0103e0f:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103e16:	e8 e9 d7 ff ff       	call   c0101604 <__panic>

	list_entry_t free_lists_store[MAX_ORDER + 1];
	unsigned int nr_free_store[MAX_ORDER + 1];

	for (i = 0; i <= MAX_ORDER; i ++) {
c0103e1b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103e22:	e9 d4 00 00 00       	jmp    c0103efb <buddy_check+0x2c4>
		free_lists_store[i] = free_list(i);
c0103e27:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0103e2a:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103e2d:	89 d0                	mov    %edx,%eax
c0103e2f:	01 c0                	add    %eax,%eax
c0103e31:	01 d0                	add    %edx,%eax
c0103e33:	c1 e0 02             	shl    $0x2,%eax
c0103e36:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103e3b:	8b 50 04             	mov    0x4(%eax),%edx
c0103e3e:	8b 00                	mov    (%eax),%eax
c0103e40:	89 84 cd e8 fe ff ff 	mov    %eax,-0x118(%ebp,%ecx,8)
c0103e47:	89 94 cd ec fe ff ff 	mov    %edx,-0x114(%ebp,%ecx,8)
		list_init(&free_list(i));
c0103e4e:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103e51:	89 d0                	mov    %edx,%eax
c0103e53:	01 c0                	add    %eax,%eax
c0103e55:	01 d0                	add    %edx,%eax
c0103e57:	c1 e0 02             	shl    $0x2,%eax
c0103e5a:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103e5f:	89 45 a8             	mov    %eax,-0x58(%ebp)
 * list_init - initialize a new entry
 * @elm:		new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
	elm->prev = elm->next = elm;
c0103e62:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103e65:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0103e68:	89 50 04             	mov    %edx,0x4(%eax)
c0103e6b:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103e6e:	8b 50 04             	mov    0x4(%eax),%edx
c0103e71:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103e74:	89 10                	mov    %edx,(%eax)
		assert(list_empty(&free_list(i)));
c0103e76:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103e79:	89 d0                	mov    %edx,%eax
c0103e7b:	01 c0                	add    %eax,%eax
c0103e7d:	01 d0                	add    %edx,%eax
c0103e7f:	c1 e0 02             	shl    $0x2,%eax
c0103e82:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103e87:	89 45 a4             	mov    %eax,-0x5c(%ebp)
 * list_empty - tests whether a list is empty
 * @list:		the list to test.
 * */
static inline bool
list_empty(list_entry_t *list) {
	return list->next == list;
c0103e8a:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0103e8d:	8b 40 04             	mov    0x4(%eax),%eax
c0103e90:	39 45 a4             	cmp    %eax,-0x5c(%ebp)
c0103e93:	0f 94 c0             	sete   %al
c0103e96:	0f b6 c0             	movzbl %al,%eax
c0103e99:	85 c0                	test   %eax,%eax
c0103e9b:	75 24                	jne    c0103ec1 <buddy_check+0x28a>
c0103e9d:	c7 44 24 0c 5a 7b 10 	movl   $0xc0107b5a,0xc(%esp)
c0103ea4:	c0 
c0103ea5:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103eac:	c0 
c0103ead:	c7 44 24 04 ea 00 00 	movl   $0xea,0x4(%esp)
c0103eb4:	00 
c0103eb5:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103ebc:	e8 43 d7 ff ff       	call   c0101604 <__panic>
		nr_free_store[i] = nr_free(i);
c0103ec1:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103ec4:	89 d0                	mov    %edx,%eax
c0103ec6:	01 c0                	add    %eax,%eax
c0103ec8:	01 d0                	add    %edx,%eax
c0103eca:	c1 e0 02             	shl    $0x2,%eax
c0103ecd:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103ed2:	8b 50 08             	mov    0x8(%eax),%edx
c0103ed5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103ed8:	89 94 85 bc fe ff ff 	mov    %edx,-0x144(%ebp,%eax,4)
		nr_free(i) = 0;
c0103edf:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103ee2:	89 d0                	mov    %edx,%eax
c0103ee4:	01 c0                	add    %eax,%eax
c0103ee6:	01 d0                	add    %edx,%eax
c0103ee8:	c1 e0 02             	shl    $0x2,%eax
c0103eeb:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c0103ef0:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
	assert(!PageProperty(p0));

	list_entry_t free_lists_store[MAX_ORDER + 1];
	unsigned int nr_free_store[MAX_ORDER + 1];

	for (i = 0; i <= MAX_ORDER; i ++) {
c0103ef7:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103efb:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c0103eff:	0f 8e 22 ff ff ff    	jle    c0103e27 <buddy_check+0x1f0>
		assert(list_empty(&free_list(i)));
		nr_free_store[i] = nr_free(i);
		nr_free(i) = 0;
	}

	assert(nr_free_pages() == 0);
c0103f05:	e8 4b 0b 00 00       	call   c0104a55 <nr_free_pages>
c0103f0a:	85 c0                	test   %eax,%eax
c0103f0c:	74 24                	je     c0103f32 <buddy_check+0x2fb>
c0103f0e:	c7 44 24 0c 74 7b 10 	movl   $0xc0107b74,0xc(%esp)
c0103f15:	c0 
c0103f16:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103f1d:	c0 
c0103f1e:	c7 44 24 04 ef 00 00 	movl   $0xef,0x4(%esp)
c0103f25:	00 
c0103f26:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103f2d:	e8 d2 d6 ff ff       	call   c0101604 <__panic>
	assert(alloc_page() == NULL);
c0103f32:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103f39:	e8 b4 0a 00 00       	call   c01049f2 <alloc_pages>
c0103f3e:	85 c0                	test   %eax,%eax
c0103f40:	74 24                	je     c0103f66 <buddy_check+0x32f>
c0103f42:	c7 44 24 0c 89 7b 10 	movl   $0xc0107b89,0xc(%esp)
c0103f49:	c0 
c0103f4a:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103f51:	c0 
c0103f52:	c7 44 24 04 f0 00 00 	movl   $0xf0,0x4(%esp)
c0103f59:	00 
c0103f5a:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103f61:	e8 9e d6 ff ff       	call   c0101604 <__panic>
	free_pages(p0, 8);
c0103f66:	c7 44 24 04 08 00 00 	movl   $0x8,0x4(%esp)
c0103f6d:	00 
c0103f6e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103f71:	89 04 24             	mov    %eax,(%esp)
c0103f74:	e8 aa 0a 00 00       	call   c0104a23 <free_pages>
	assert(nr_free_pages() == 8);
c0103f79:	e8 d7 0a 00 00       	call   c0104a55 <nr_free_pages>
c0103f7e:	83 f8 08             	cmp    $0x8,%eax
c0103f81:	74 24                	je     c0103fa7 <buddy_check+0x370>
c0103f83:	c7 44 24 0c 9e 7b 10 	movl   $0xc0107b9e,0xc(%esp)
c0103f8a:	c0 
c0103f8b:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103f92:	c0 
c0103f93:	c7 44 24 04 f2 00 00 	movl   $0xf2,0x4(%esp)
c0103f9a:	00 
c0103f9b:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103fa2:	e8 5d d6 ff ff       	call   c0101604 <__panic>
	assert(PageProperty(p0) && p0->property == 3);
c0103fa7:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103faa:	83 c0 04             	add    $0x4,%eax
c0103fad:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c0103fb4:	89 45 9c             	mov    %eax,-0x64(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103fb7:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0103fba:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0103fbd:	0f a3 10             	bt     %edx,(%eax)
c0103fc0:	19 db                	sbb    %ebx,%ebx
c0103fc2:	89 5d 98             	mov    %ebx,-0x68(%ebp)
	return oldbit != 0;
c0103fc5:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
c0103fc9:	0f 95 c0             	setne  %al
c0103fcc:	0f b6 c0             	movzbl %al,%eax
c0103fcf:	85 c0                	test   %eax,%eax
c0103fd1:	74 0b                	je     c0103fde <buddy_check+0x3a7>
c0103fd3:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103fd6:	8b 40 08             	mov    0x8(%eax),%eax
c0103fd9:	83 f8 03             	cmp    $0x3,%eax
c0103fdc:	74 24                	je     c0104002 <buddy_check+0x3cb>
c0103fde:	c7 44 24 0c b4 7b 10 	movl   $0xc0107bb4,0xc(%esp)
c0103fe5:	c0 
c0103fe6:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0103fed:	c0 
c0103fee:	c7 44 24 04 f3 00 00 	movl   $0xf3,0x4(%esp)
c0103ff5:	00 
c0103ff6:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0103ffd:	e8 02 d6 ff ff       	call   c0101604 <__panic>
	assert((p0 = alloc_pages(6)) != NULL && !PageProperty(p0) && nr_free_pages() == 2);
c0104002:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
c0104009:	e8 e4 09 00 00       	call   c01049f2 <alloc_pages>
c010400e:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0104011:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0104015:	74 36                	je     c010404d <buddy_check+0x416>
c0104017:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010401a:	83 c0 04             	add    $0x4,%eax
c010401d:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
c0104024:	89 45 90             	mov    %eax,-0x70(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104027:	8b 45 90             	mov    -0x70(%ebp),%eax
c010402a:	8b 55 94             	mov    -0x6c(%ebp),%edx
c010402d:	0f a3 10             	bt     %edx,(%eax)
c0104030:	19 db                	sbb    %ebx,%ebx
c0104032:	89 5d 8c             	mov    %ebx,-0x74(%ebp)
	return oldbit != 0;
c0104035:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
c0104039:	0f 95 c0             	setne  %al
c010403c:	0f b6 c0             	movzbl %al,%eax
c010403f:	85 c0                	test   %eax,%eax
c0104041:	75 0a                	jne    c010404d <buddy_check+0x416>
c0104043:	e8 0d 0a 00 00       	call   c0104a55 <nr_free_pages>
c0104048:	83 f8 02             	cmp    $0x2,%eax
c010404b:	74 24                	je     c0104071 <buddy_check+0x43a>
c010404d:	c7 44 24 0c dc 7b 10 	movl   $0xc0107bdc,0xc(%esp)
c0104054:	c0 
c0104055:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010405c:	c0 
c010405d:	c7 44 24 04 f4 00 00 	movl   $0xf4,0x4(%esp)
c0104064:	00 
c0104065:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010406c:	e8 93 d5 ff ff       	call   c0101604 <__panic>

	assert((p1 = alloc_pages(2)) != NULL && p1 == p0 + 6);
c0104071:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c0104078:	e8 75 09 00 00       	call   c01049f2 <alloc_pages>
c010407d:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104080:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
c0104084:	74 0d                	je     c0104093 <buddy_check+0x45c>
c0104086:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104089:	05 90 00 00 00       	add    $0x90,%eax
c010408e:	3b 45 d0             	cmp    -0x30(%ebp),%eax
c0104091:	74 24                	je     c01040b7 <buddy_check+0x480>
c0104093:	c7 44 24 0c 28 7c 10 	movl   $0xc0107c28,0xc(%esp)
c010409a:	c0 
c010409b:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01040a2:	c0 
c01040a3:	c7 44 24 04 f6 00 00 	movl   $0xf6,0x4(%esp)
c01040aa:	00 
c01040ab:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01040b2:	e8 4d d5 ff ff       	call   c0101604 <__panic>
	assert(nr_free_pages() == 0);
c01040b7:	e8 99 09 00 00       	call   c0104a55 <nr_free_pages>
c01040bc:	85 c0                	test   %eax,%eax
c01040be:	74 24                	je     c01040e4 <buddy_check+0x4ad>
c01040c0:	c7 44 24 0c 74 7b 10 	movl   $0xc0107b74,0xc(%esp)
c01040c7:	c0 
c01040c8:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01040cf:	c0 
c01040d0:	c7 44 24 04 f7 00 00 	movl   $0xf7,0x4(%esp)
c01040d7:	00 
c01040d8:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01040df:	e8 20 d5 ff ff       	call   c0101604 <__panic>

	free_pages(p0, 3);
c01040e4:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c01040eb:	00 
c01040ec:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01040ef:	89 04 24             	mov    %eax,(%esp)
c01040f2:	e8 2c 09 00 00       	call   c0104a23 <free_pages>
	assert(PageProperty(p0) && p0->property == 1);
c01040f7:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01040fa:	83 c0 04             	add    $0x4,%eax
c01040fd:	c7 45 88 01 00 00 00 	movl   $0x1,-0x78(%ebp)
c0104104:	89 45 84             	mov    %eax,-0x7c(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104107:	8b 45 84             	mov    -0x7c(%ebp),%eax
c010410a:	8b 55 88             	mov    -0x78(%ebp),%edx
c010410d:	0f a3 10             	bt     %edx,(%eax)
c0104110:	19 db                	sbb    %ebx,%ebx
c0104112:	89 5d 80             	mov    %ebx,-0x80(%ebp)
	return oldbit != 0;
c0104115:	83 7d 80 00          	cmpl   $0x0,-0x80(%ebp)
c0104119:	0f 95 c0             	setne  %al
c010411c:	0f b6 c0             	movzbl %al,%eax
c010411f:	85 c0                	test   %eax,%eax
c0104121:	74 0b                	je     c010412e <buddy_check+0x4f7>
c0104123:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104126:	8b 40 08             	mov    0x8(%eax),%eax
c0104129:	83 f8 01             	cmp    $0x1,%eax
c010412c:	74 24                	je     c0104152 <buddy_check+0x51b>
c010412e:	c7 44 24 0c 58 7c 10 	movl   $0xc0107c58,0xc(%esp)
c0104135:	c0 
c0104136:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010413d:	c0 
c010413e:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c0104145:	00 
c0104146:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010414d:	e8 b2 d4 ff ff       	call   c0101604 <__panic>
	assert(PageProperty(p0 + 2) && p0[2].property == 0);
c0104152:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104155:	83 c0 30             	add    $0x30,%eax
c0104158:	83 c0 04             	add    $0x4,%eax
c010415b:	c7 85 7c ff ff ff 01 	movl   $0x1,-0x84(%ebp)
c0104162:	00 00 00 
c0104165:	89 85 78 ff ff ff    	mov    %eax,-0x88(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010416b:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
c0104171:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
c0104177:	0f a3 10             	bt     %edx,(%eax)
c010417a:	19 db                	sbb    %ebx,%ebx
c010417c:	89 9d 74 ff ff ff    	mov    %ebx,-0x8c(%ebp)
	return oldbit != 0;
c0104182:	83 bd 74 ff ff ff 00 	cmpl   $0x0,-0x8c(%ebp)
c0104189:	0f 95 c0             	setne  %al
c010418c:	0f b6 c0             	movzbl %al,%eax
c010418f:	85 c0                	test   %eax,%eax
c0104191:	74 0d                	je     c01041a0 <buddy_check+0x569>
c0104193:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104196:	83 c0 30             	add    $0x30,%eax
c0104199:	8b 40 08             	mov    0x8(%eax),%eax
c010419c:	85 c0                	test   %eax,%eax
c010419e:	74 24                	je     c01041c4 <buddy_check+0x58d>
c01041a0:	c7 44 24 0c 80 7c 10 	movl   $0xc0107c80,0xc(%esp)
c01041a7:	c0 
c01041a8:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01041af:	c0 
c01041b0:	c7 44 24 04 fb 00 00 	movl   $0xfb,0x4(%esp)
c01041b7:	00 
c01041b8:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01041bf:	e8 40 d4 ff ff       	call   c0101604 <__panic>

	free_pages(p0 + 3, 3);
c01041c4:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01041c7:	83 c0 48             	add    $0x48,%eax
c01041ca:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c01041d1:	00 
c01041d2:	89 04 24             	mov    %eax,(%esp)
c01041d5:	e8 49 08 00 00       	call   c0104a23 <free_pages>
	free_pages(p1, 2);
c01041da:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c01041e1:	00 
c01041e2:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01041e5:	89 04 24             	mov    %eax,(%esp)
c01041e8:	e8 36 08 00 00       	call   c0104a23 <free_pages>

	assert(PageProperty(p0) && p0->property == 3);
c01041ed:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01041f0:	83 c0 04             	add    $0x4,%eax
c01041f3:	c7 85 70 ff ff ff 01 	movl   $0x1,-0x90(%ebp)
c01041fa:	00 00 00 
c01041fd:	89 85 6c ff ff ff    	mov    %eax,-0x94(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104203:	8b 85 6c ff ff ff    	mov    -0x94(%ebp),%eax
c0104209:	8b 95 70 ff ff ff    	mov    -0x90(%ebp),%edx
c010420f:	0f a3 10             	bt     %edx,(%eax)
c0104212:	19 db                	sbb    %ebx,%ebx
c0104214:	89 9d 68 ff ff ff    	mov    %ebx,-0x98(%ebp)
	return oldbit != 0;
c010421a:	83 bd 68 ff ff ff 00 	cmpl   $0x0,-0x98(%ebp)
c0104221:	0f 95 c0             	setne  %al
c0104224:	0f b6 c0             	movzbl %al,%eax
c0104227:	85 c0                	test   %eax,%eax
c0104229:	74 0b                	je     c0104236 <buddy_check+0x5ff>
c010422b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010422e:	8b 40 08             	mov    0x8(%eax),%eax
c0104231:	83 f8 03             	cmp    $0x3,%eax
c0104234:	74 24                	je     c010425a <buddy_check+0x623>
c0104236:	c7 44 24 0c b4 7b 10 	movl   $0xc0107bb4,0xc(%esp)
c010423d:	c0 
c010423e:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0104245:	c0 
c0104246:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
c010424d:	00 
c010424e:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0104255:	e8 aa d3 ff ff       	call   c0101604 <__panic>

	assert((p0 = alloc_pages(6)) != NULL);
c010425a:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
c0104261:	e8 8c 07 00 00       	call   c01049f2 <alloc_pages>
c0104266:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0104269:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c010426d:	75 24                	jne    c0104293 <buddy_check+0x65c>
c010426f:	c7 44 24 0c ac 7c 10 	movl   $0xc0107cac,0xc(%esp)
c0104276:	c0 
c0104277:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010427e:	c0 
c010427f:	c7 44 24 04 02 01 00 	movl   $0x102,0x4(%esp)
c0104286:	00 
c0104287:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010428e:	e8 71 d3 ff ff       	call   c0101604 <__panic>
	assert((p1 = alloc_pages(2)) != NULL);
c0104293:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c010429a:	e8 53 07 00 00       	call   c01049f2 <alloc_pages>
c010429f:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01042a2:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
c01042a6:	75 24                	jne    c01042cc <buddy_check+0x695>
c01042a8:	c7 44 24 0c ca 7c 10 	movl   $0xc0107cca,0xc(%esp)
c01042af:	c0 
c01042b0:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01042b7:	c0 
c01042b8:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
c01042bf:	00 
c01042c0:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01042c7:	e8 38 d3 ff ff       	call   c0101604 <__panic>
	free_pages(p0 + 4, 2);
c01042cc:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01042cf:	83 c0 60             	add    $0x60,%eax
c01042d2:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c01042d9:	00 
c01042da:	89 04 24             	mov    %eax,(%esp)
c01042dd:	e8 41 07 00 00       	call   c0104a23 <free_pages>
	free_pages(p1, 2);
c01042e2:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c01042e9:	00 
c01042ea:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01042ed:	89 04 24             	mov    %eax,(%esp)
c01042f0:	e8 2e 07 00 00       	call   c0104a23 <free_pages>

	p1 = p0 + 4;
c01042f5:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01042f8:	83 c0 60             	add    $0x60,%eax
c01042fb:	89 45 d0             	mov    %eax,-0x30(%ebp)
	assert(PageProperty(p1) && p1->property == 2);
c01042fe:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104301:	83 c0 04             	add    $0x4,%eax
c0104304:	c7 85 64 ff ff ff 01 	movl   $0x1,-0x9c(%ebp)
c010430b:	00 00 00 
c010430e:	89 85 60 ff ff ff    	mov    %eax,-0xa0(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104314:	8b 85 60 ff ff ff    	mov    -0xa0(%ebp),%eax
c010431a:	8b 95 64 ff ff ff    	mov    -0x9c(%ebp),%edx
c0104320:	0f a3 10             	bt     %edx,(%eax)
c0104323:	19 db                	sbb    %ebx,%ebx
c0104325:	89 9d 5c ff ff ff    	mov    %ebx,-0xa4(%ebp)
	return oldbit != 0;
c010432b:	83 bd 5c ff ff ff 00 	cmpl   $0x0,-0xa4(%ebp)
c0104332:	0f 95 c0             	setne  %al
c0104335:	0f b6 c0             	movzbl %al,%eax
c0104338:	85 c0                	test   %eax,%eax
c010433a:	74 0b                	je     c0104347 <buddy_check+0x710>
c010433c:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010433f:	8b 40 08             	mov    0x8(%eax),%eax
c0104342:	83 f8 02             	cmp    $0x2,%eax
c0104345:	74 24                	je     c010436b <buddy_check+0x734>
c0104347:	c7 44 24 0c e8 7c 10 	movl   $0xc0107ce8,0xc(%esp)
c010434e:	c0 
c010434f:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0104356:	c0 
c0104357:	c7 44 24 04 08 01 00 	movl   $0x108,0x4(%esp)
c010435e:	00 
c010435f:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0104366:	e8 99 d2 ff ff       	call   c0101604 <__panic>
	free_pages(p0, 4);
c010436b:	c7 44 24 04 04 00 00 	movl   $0x4,0x4(%esp)
c0104372:	00 
c0104373:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104376:	89 04 24             	mov    %eax,(%esp)
c0104379:	e8 a5 06 00 00       	call   c0104a23 <free_pages>
	assert(PageProperty(p0) && p0->property == 3);
c010437e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104381:	83 c0 04             	add    $0x4,%eax
c0104384:	c7 85 58 ff ff ff 01 	movl   $0x1,-0xa8(%ebp)
c010438b:	00 00 00 
c010438e:	89 85 54 ff ff ff    	mov    %eax,-0xac(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104394:	8b 85 54 ff ff ff    	mov    -0xac(%ebp),%eax
c010439a:	8b 95 58 ff ff ff    	mov    -0xa8(%ebp),%edx
c01043a0:	0f a3 10             	bt     %edx,(%eax)
c01043a3:	19 db                	sbb    %ebx,%ebx
c01043a5:	89 9d 50 ff ff ff    	mov    %ebx,-0xb0(%ebp)
	return oldbit != 0;
c01043ab:	83 bd 50 ff ff ff 00 	cmpl   $0x0,-0xb0(%ebp)
c01043b2:	0f 95 c0             	setne  %al
c01043b5:	0f b6 c0             	movzbl %al,%eax
c01043b8:	85 c0                	test   %eax,%eax
c01043ba:	74 0b                	je     c01043c7 <buddy_check+0x790>
c01043bc:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01043bf:	8b 40 08             	mov    0x8(%eax),%eax
c01043c2:	83 f8 03             	cmp    $0x3,%eax
c01043c5:	74 24                	je     c01043eb <buddy_check+0x7b4>
c01043c7:	c7 44 24 0c b4 7b 10 	movl   $0xc0107bb4,0xc(%esp)
c01043ce:	c0 
c01043cf:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01043d6:	c0 
c01043d7:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
c01043de:	00 
c01043df:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01043e6:	e8 19 d2 ff ff       	call   c0101604 <__panic>

	assert((p0 = alloc_pages(8)) != NULL);
c01043eb:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c01043f2:	e8 fb 05 00 00       	call   c01049f2 <alloc_pages>
c01043f7:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01043fa:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c01043fe:	75 24                	jne    c0104424 <buddy_check+0x7ed>
c0104400:	c7 44 24 0c 0e 7d 10 	movl   $0xc0107d0e,0xc(%esp)
c0104407:	c0 
c0104408:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010440f:	c0 
c0104410:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
c0104417:	00 
c0104418:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010441f:	e8 e0 d1 ff ff       	call   c0101604 <__panic>
	assert(alloc_page() == NULL && nr_free_pages() == 0);
c0104424:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010442b:	e8 c2 05 00 00       	call   c01049f2 <alloc_pages>
c0104430:	85 c0                	test   %eax,%eax
c0104432:	75 09                	jne    c010443d <buddy_check+0x806>
c0104434:	e8 1c 06 00 00       	call   c0104a55 <nr_free_pages>
c0104439:	85 c0                	test   %eax,%eax
c010443b:	74 24                	je     c0104461 <buddy_check+0x82a>
c010443d:	c7 44 24 0c 2c 7d 10 	movl   $0xc0107d2c,0xc(%esp)
c0104444:	c0 
c0104445:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010444c:	c0 
c010444d:	c7 44 24 04 0d 01 00 	movl   $0x10d,0x4(%esp)
c0104454:	00 
c0104455:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010445c:	e8 a3 d1 ff ff       	call   c0101604 <__panic>

	for (i = 0; i <= MAX_ORDER; i ++) {
c0104461:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0104468:	eb 4a                	jmp    c01044b4 <buddy_check+0x87d>
		free_list(i) = free_lists_store[i];
c010446a:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010446d:	89 d0                	mov    %edx,%eax
c010446f:	01 c0                	add    %eax,%eax
c0104471:	01 d0                	add    %edx,%eax
c0104473:	c1 e0 02             	shl    $0x2,%eax
c0104476:	8d 88 60 b9 11 c0    	lea    -0x3fee46a0(%eax),%ecx
c010447c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010447f:	8b 94 c5 ec fe ff ff 	mov    -0x114(%ebp,%eax,8),%edx
c0104486:	8b 84 c5 e8 fe ff ff 	mov    -0x118(%ebp,%eax,8),%eax
c010448d:	89 01                	mov    %eax,(%ecx)
c010448f:	89 51 04             	mov    %edx,0x4(%ecx)
		nr_free(i) = nr_free_store[i];
c0104492:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104495:	8b 8c 85 bc fe ff ff 	mov    -0x144(%ebp,%eax,4),%ecx
c010449c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010449f:	89 d0                	mov    %edx,%eax
c01044a1:	01 c0                	add    %eax,%eax
c01044a3:	01 d0                	add    %edx,%eax
c01044a5:	c1 e0 02             	shl    $0x2,%eax
c01044a8:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c01044ad:	89 48 08             	mov    %ecx,0x8(%eax)
	assert(PageProperty(p0) && p0->property == 3);

	assert((p0 = alloc_pages(8)) != NULL);
	assert(alloc_page() == NULL && nr_free_pages() == 0);

	for (i = 0; i <= MAX_ORDER; i ++) {
c01044b0:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01044b4:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c01044b8:	7e b0                	jle    c010446a <buddy_check+0x833>
		free_list(i) = free_lists_store[i];
		nr_free(i) = nr_free_store[i];
	}

	free_pages(p0, 8);
c01044ba:	c7 44 24 04 08 00 00 	movl   $0x8,0x4(%esp)
c01044c1:	00 
c01044c2:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01044c5:	89 04 24             	mov    %eax,(%esp)
c01044c8:	e8 56 05 00 00       	call   c0104a23 <free_pages>
	free_pages(buddy, 8);
c01044cd:	c7 44 24 04 08 00 00 	movl   $0x8,0x4(%esp)
c01044d4:	00 
c01044d5:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01044d8:	89 04 24             	mov    %eax,(%esp)
c01044db:	e8 43 05 00 00       	call   c0104a23 <free_pages>

	assert(total == nr_free_pages());
c01044e0:	8b 5d ec             	mov    -0x14(%ebp),%ebx
c01044e3:	e8 6d 05 00 00       	call   c0104a55 <nr_free_pages>
c01044e8:	39 c3                	cmp    %eax,%ebx
c01044ea:	74 24                	je     c0104510 <buddy_check+0x8d9>
c01044ec:	c7 44 24 0c 0c 7b 10 	movl   $0xc0107b0c,0xc(%esp)
c01044f3:	c0 
c01044f4:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c01044fb:	c0 
c01044fc:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
c0104503:	00 
c0104504:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010450b:	e8 f4 d0 ff ff       	call   c0101604 <__panic>

	for (i = 0; i <= MAX_ORDER; i ++) {
c0104510:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0104517:	e9 d3 00 00 00       	jmp    c01045ef <buddy_check+0x9b8>
		list_entry_t *list = &free_list(i), *le = list;
c010451c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010451f:	89 d0                	mov    %edx,%eax
c0104521:	01 c0                	add    %eax,%eax
c0104523:	01 d0                	add    %edx,%eax
c0104525:	c1 e0 02             	shl    $0x2,%eax
c0104528:	05 60 b9 11 c0       	add    $0xc011b960,%eax
c010452d:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0104530:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0104533:	89 45 e4             	mov    %eax,-0x1c(%ebp)
		while ((le = list_next(le)) != list) {
c0104536:	e9 8f 00 00 00       	jmp    c01045ca <buddy_check+0x993>
			struct Page *p = le2page(le, page_link);
c010453b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010453e:	83 e8 10             	sub    $0x10,%eax
c0104541:	89 45 c8             	mov    %eax,-0x38(%ebp)
			assert(PageProperty(p) && p->property == i);
c0104544:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104547:	83 c0 04             	add    $0x4,%eax
c010454a:	c7 85 4c ff ff ff 01 	movl   $0x1,-0xb4(%ebp)
c0104551:	00 00 00 
c0104554:	89 85 48 ff ff ff    	mov    %eax,-0xb8(%ebp)
 * @addr:	the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
	int oldbit;
	asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010455a:	8b 85 48 ff ff ff    	mov    -0xb8(%ebp),%eax
c0104560:	8b 95 4c ff ff ff    	mov    -0xb4(%ebp),%edx
c0104566:	0f a3 10             	bt     %edx,(%eax)
c0104569:	19 db                	sbb    %ebx,%ebx
c010456b:	89 9d 44 ff ff ff    	mov    %ebx,-0xbc(%ebp)
	return oldbit != 0;
c0104571:	83 bd 44 ff ff ff 00 	cmpl   $0x0,-0xbc(%ebp)
c0104578:	0f 95 c0             	setne  %al
c010457b:	0f b6 c0             	movzbl %al,%eax
c010457e:	85 c0                	test   %eax,%eax
c0104580:	74 0d                	je     c010458f <buddy_check+0x958>
c0104582:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104585:	8b 50 08             	mov    0x8(%eax),%edx
c0104588:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010458b:	39 c2                	cmp    %eax,%edx
c010458d:	74 24                	je     c01045b3 <buddy_check+0x97c>
c010458f:	c7 44 24 0c e8 7a 10 	movl   $0xc0107ae8,0xc(%esp)
c0104596:	c0 
c0104597:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010459e:	c0 
c010459f:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
c01045a6:	00 
c01045a7:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c01045ae:	e8 51 d0 ff ff       	call   c0101604 <__panic>
			count --, total -= (1 << i);
c01045b3:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
c01045b7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045ba:	ba 01 00 00 00       	mov    $0x1,%edx
c01045bf:	89 d3                	mov    %edx,%ebx
c01045c1:	89 c1                	mov    %eax,%ecx
c01045c3:	d3 e3                	shl    %cl,%ebx
c01045c5:	89 d8                	mov    %ebx,%eax
c01045c7:	29 45 ec             	sub    %eax,-0x14(%ebp)
c01045ca:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01045cd:	89 85 40 ff ff ff    	mov    %eax,-0xc0(%ebp)
 * list_next - get the next entry
 * @listelm:	the list head
 **/
static list_entry_t *
list_next(list_entry_t *listelm) {
	return listelm->next;
c01045d3:	8b 85 40 ff ff ff    	mov    -0xc0(%ebp),%eax
c01045d9:	8b 40 04             	mov    0x4(%eax),%eax

	assert(total == nr_free_pages());

	for (i = 0; i <= MAX_ORDER; i ++) {
		list_entry_t *list = &free_list(i), *le = list;
		while ((le = list_next(le)) != list) {
c01045dc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01045df:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01045e2:	3b 45 cc             	cmp    -0x34(%ebp),%eax
c01045e5:	0f 85 50 ff ff ff    	jne    c010453b <buddy_check+0x904>
	free_pages(p0, 8);
	free_pages(buddy, 8);

	assert(total == nr_free_pages());

	for (i = 0; i <= MAX_ORDER; i ++) {
c01045eb:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01045ef:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c01045f3:	0f 8e 23 ff ff ff    	jle    c010451c <buddy_check+0x8e5>
			struct Page *p = le2page(le, page_link);
			assert(PageProperty(p) && p->property == i);
			count --, total -= (1 << i);
		}
	}
	assert(count == 0);
c01045f9:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01045fd:	74 24                	je     c0104623 <buddy_check+0x9ec>
c01045ff:	c7 44 24 0c 59 7d 10 	movl   $0xc0107d59,0xc(%esp)
c0104606:	c0 
c0104607:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c010460e:	c0 
c010460f:	c7 44 24 04 21 01 00 	movl   $0x121,0x4(%esp)
c0104616:	00 
c0104617:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c010461e:	e8 e1 cf ff ff       	call   c0101604 <__panic>
	assert(total == 0);
c0104623:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0104627:	74 24                	je     c010464d <buddy_check+0xa16>
c0104629:	c7 44 24 0c 64 7d 10 	movl   $0xc0107d64,0xc(%esp)
c0104630:	c0 
c0104631:	c7 44 24 08 31 7a 10 	movl   $0xc0107a31,0x8(%esp)
c0104638:	c0 
c0104639:	c7 44 24 04 22 01 00 	movl   $0x122,0x4(%esp)
c0104640:	00 
c0104641:	c7 04 24 46 7a 10 c0 	movl   $0xc0107a46,(%esp)
c0104648:	e8 b7 cf ff ff       	call   c0101604 <__panic>
}
c010464d:	81 c4 54 01 00 00    	add    $0x154,%esp
c0104653:	5b                   	pop    %ebx
c0104654:	5d                   	pop    %ebp
c0104655:	c3                   	ret    
	...

c0104658 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c0104658:	55                   	push   %ebp
c0104659:	89 e5                	mov    %esp,%ebp
	return page - pages;
c010465b:	8b 55 08             	mov    0x8(%ebp),%edx
c010465e:	a1 98 ba 11 c0       	mov    0xc011ba98,%eax
c0104663:	89 d1                	mov    %edx,%ecx
c0104665:	29 c1                	sub    %eax,%ecx
c0104667:	89 c8                	mov    %ecx,%eax
c0104669:	c1 f8 03             	sar    $0x3,%eax
c010466c:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
}
c0104672:	5d                   	pop    %ebp
c0104673:	c3                   	ret    

c0104674 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
c0104674:	55                   	push   %ebp
c0104675:	89 e5                	mov    %esp,%ebp
c0104677:	83 ec 04             	sub    $0x4,%esp
	return page2ppn(page) << PGSHIFT;
c010467a:	8b 45 08             	mov    0x8(%ebp),%eax
c010467d:	89 04 24             	mov    %eax,(%esp)
c0104680:	e8 d3 ff ff ff       	call   c0104658 <page2ppn>
c0104685:	c1 e0 0c             	shl    $0xc,%eax
}
c0104688:	c9                   	leave  
c0104689:	c3                   	ret    

c010468a <pa2page>:

static inline struct Page *
pa2page(uintptr_t pa) {
c010468a:	55                   	push   %ebp
c010468b:	89 e5                	mov    %esp,%ebp
c010468d:	83 ec 18             	sub    $0x18,%esp
	if (PPN(pa) >= npage) {
c0104690:	8b 45 08             	mov    0x8(%ebp),%eax
c0104693:	89 c2                	mov    %eax,%edx
c0104695:	c1 ea 0c             	shr    $0xc,%edx
c0104698:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c010469d:	39 c2                	cmp    %eax,%edx
c010469f:	72 1c                	jb     c01046bd <pa2page+0x33>
		panic("pa2page called with invalid pa");
c01046a1:	c7 44 24 08 a0 7d 10 	movl   $0xc0107da0,0x8(%esp)
c01046a8:	c0 
c01046a9:	c7 44 24 04 55 00 00 	movl   $0x55,0x4(%esp)
c01046b0:	00 
c01046b1:	c7 04 24 bf 7d 10 c0 	movl   $0xc0107dbf,(%esp)
c01046b8:	e8 47 cf ff ff       	call   c0101604 <__panic>
	}
	return &pages[PPN(pa)];
c01046bd:	8b 0d 98 ba 11 c0    	mov    0xc011ba98,%ecx
c01046c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01046c6:	89 c2                	mov    %eax,%edx
c01046c8:	c1 ea 0c             	shr    $0xc,%edx
c01046cb:	89 d0                	mov    %edx,%eax
c01046cd:	01 c0                	add    %eax,%eax
c01046cf:	01 d0                	add    %edx,%eax
c01046d1:	c1 e0 03             	shl    $0x3,%eax
c01046d4:	8d 04 01             	lea    (%ecx,%eax,1),%eax
}
c01046d7:	c9                   	leave  
c01046d8:	c3                   	ret    

c01046d9 <page2kva>:

static inline void *
page2kva(struct Page *page) {
c01046d9:	55                   	push   %ebp
c01046da:	89 e5                	mov    %esp,%ebp
c01046dc:	83 ec 28             	sub    $0x28,%esp
	return KADDR(page2pa(page));
c01046df:	8b 45 08             	mov    0x8(%ebp),%eax
c01046e2:	89 04 24             	mov    %eax,(%esp)
c01046e5:	e8 8a ff ff ff       	call   c0104674 <page2pa>
c01046ea:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01046ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046f0:	c1 e8 0c             	shr    $0xc,%eax
c01046f3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01046f6:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c01046fb:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c01046fe:	72 23                	jb     c0104723 <page2kva+0x4a>
c0104700:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104703:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104707:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c010470e:	c0 
c010470f:	c7 44 24 04 5c 00 00 	movl   $0x5c,0x4(%esp)
c0104716:	00 
c0104717:	c7 04 24 bf 7d 10 c0 	movl   $0xc0107dbf,(%esp)
c010471e:	e8 e1 ce ff ff       	call   c0101604 <__panic>
c0104723:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104726:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c010472b:	c9                   	leave  
c010472c:	c3                   	ret    

c010472d <pte2page>:
kva2page(void *kva) {
	return pa2page(PADDR(kva));
}

static inline struct Page *
pte2page(pte_t pte) {
c010472d:	55                   	push   %ebp
c010472e:	89 e5                	mov    %esp,%ebp
c0104730:	83 ec 18             	sub    $0x18,%esp
	if (!(pte & PTE_P)) {
c0104733:	8b 45 08             	mov    0x8(%ebp),%eax
c0104736:	83 e0 01             	and    $0x1,%eax
c0104739:	85 c0                	test   %eax,%eax
c010473b:	75 1c                	jne    c0104759 <pte2page+0x2c>
		panic("pte2page called with invalid pte");
c010473d:	c7 44 24 08 f4 7d 10 	movl   $0xc0107df4,0x8(%esp)
c0104744:	c0 
c0104745:	c7 44 24 04 67 00 00 	movl   $0x67,0x4(%esp)
c010474c:	00 
c010474d:	c7 04 24 bf 7d 10 c0 	movl   $0xc0107dbf,(%esp)
c0104754:	e8 ab ce ff ff       	call   c0101604 <__panic>
	}
	return pa2page(PTE_ADDR(pte));
c0104759:	8b 45 08             	mov    0x8(%ebp),%eax
c010475c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104761:	89 04 24             	mov    %eax,(%esp)
c0104764:	e8 21 ff ff ff       	call   c010468a <pa2page>
}
c0104769:	c9                   	leave  
c010476a:	c3                   	ret    

c010476b <page_ref>:
pde2page(pde_t pde) {
	return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c010476b:	55                   	push   %ebp
c010476c:	89 e5                	mov    %esp,%ebp
c010476e:	83 ec 10             	sub    $0x10,%esp
	return atomic_read(&(page->ref));
c0104771:	8b 45 08             	mov    0x8(%ebp),%eax
c0104774:	89 45 fc             	mov    %eax,-0x4(%ebp)
 *
 * Atomically reads the value of @v.
 * */
static inline int
atomic_read(const atomic_t *v) {
	return v->counter;
c0104777:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010477a:	8b 00                	mov    (%eax),%eax
}
c010477c:	c9                   	leave  
c010477d:	c3                   	ret    

c010477e <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c010477e:	55                   	push   %ebp
c010477f:	89 e5                	mov    %esp,%ebp
c0104781:	83 ec 10             	sub    $0x10,%esp
	atomic_set(&(page->ref), val);
c0104784:	8b 45 08             	mov    0x8(%ebp),%eax
c0104787:	89 45 fc             	mov    %eax,-0x4(%ebp)
c010478a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010478d:	89 45 f8             	mov    %eax,-0x8(%ebp)
 *
 * Atomically sets the value of @v to @i.
 * */
static inline void
atomic_set(atomic_t *v, int i) {
	v->counter = i;
c0104790:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0104793:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0104796:	89 10                	mov    %edx,(%eax)
}
c0104798:	c9                   	leave  
c0104799:	c3                   	ret    

c010479a <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c010479a:	55                   	push   %ebp
c010479b:	89 e5                	mov    %esp,%ebp
c010479d:	53                   	push   %ebx
c010479e:	83 ec 10             	sub    $0x10,%esp
	return atomic_add_return(&(page->ref), 1);
c01047a1:	8b 45 08             	mov    0x8(%ebp),%eax
c01047a4:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01047a7:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
 * Atomically adds @i to @v and returns @i + @v
 * Requires Modern 486+ processor
 * */
static inline int
atomic_add_return(atomic_t *v, int i) {
	int __i = i;
c01047ae:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047b1:	89 45 f0             	mov    %eax,-0x10(%ebp)
	asm volatile("xaddl %0, %1" : "+r" (i), "+m" (v->counter) :: "memory");
c01047b4:	8b 55 f8             	mov    -0x8(%ebp),%edx
c01047b7:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c01047ba:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01047bd:	89 cb                	mov    %ecx,%ebx
c01047bf:	0f c1 1a             	xadd   %ebx,(%edx)
c01047c2:	89 5d f4             	mov    %ebx,-0xc(%ebp)
	return i + __i;
c01047c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047c8:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01047cb:	8d 04 02             	lea    (%edx,%eax,1),%eax
}
c01047ce:	83 c4 10             	add    $0x10,%esp
c01047d1:	5b                   	pop    %ebx
c01047d2:	5d                   	pop    %ebp
c01047d3:	c3                   	ret    

c01047d4 <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c01047d4:	55                   	push   %ebp
c01047d5:	89 e5                	mov    %esp,%ebp
c01047d7:	53                   	push   %ebx
c01047d8:	83 ec 20             	sub    $0x20,%esp
	return atomic_sub_return(&(page->ref), 1);
c01047db:	8b 45 08             	mov    0x8(%ebp),%eax
c01047de:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01047e1:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
 *
 * Atomically subtracts @i from @v and returns @v - @i
 * */
static inline int
atomic_sub_return(atomic_t *v, int i) {
	return atomic_add_return(v, -i);
c01047e8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047eb:	89 c2                	mov    %eax,%edx
c01047ed:	f7 da                	neg    %edx
c01047ef:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01047f2:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01047f5:	89 55 ec             	mov    %edx,-0x14(%ebp)
 * Atomically adds @i to @v and returns @i + @v
 * Requires Modern 486+ processor
 * */
static inline int
atomic_add_return(atomic_t *v, int i) {
	int __i = i;
c01047f8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01047fb:	89 45 e8             	mov    %eax,-0x18(%ebp)
	asm volatile("xaddl %0, %1" : "+r" (i), "+m" (v->counter) :: "memory");
c01047fe:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0104801:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0104804:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104807:	89 cb                	mov    %ecx,%ebx
c0104809:	0f c1 1a             	xadd   %ebx,(%edx)
c010480c:	89 5d ec             	mov    %ebx,-0x14(%ebp)
	return i + __i;
c010480f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104812:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0104815:	8d 04 02             	lea    (%edx,%eax,1),%eax
}
c0104818:	83 c4 20             	add    $0x20,%esp
c010481b:	5b                   	pop    %ebx
c010481c:	5d                   	pop    %ebp
c010481d:	c3                   	ret    

c010481e <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c010481e:	55                   	push   %ebp
c010481f:	89 e5                	mov    %esp,%ebp
c0104821:	53                   	push   %ebx
c0104822:	83 ec 14             	sub    $0x14,%esp
}

static inline uint32_t
read_eflags(void) {
	uint32_t eflags;
	asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0104825:	9c                   	pushf  
c0104826:	5b                   	pop    %ebx
c0104827:	89 5d f4             	mov    %ebx,-0xc(%ebp)
	return eflags;
c010482a:	8b 45 f4             	mov    -0xc(%ebp),%eax
	if (read_eflags() & FL_IF) {
c010482d:	25 00 02 00 00       	and    $0x200,%eax
c0104832:	85 c0                	test   %eax,%eax
c0104834:	74 0c                	je     c0104842 <__intr_save+0x24>
		intr_disable();
c0104836:	e8 5f d8 ff ff       	call   c010209a <intr_disable>
		return 1;
c010483b:	b8 01 00 00 00       	mov    $0x1,%eax
c0104840:	eb 05                	jmp    c0104847 <__intr_save+0x29>
	}
	return 0;
c0104842:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104847:	83 c4 14             	add    $0x14,%esp
c010484a:	5b                   	pop    %ebx
c010484b:	5d                   	pop    %ebp
c010484c:	c3                   	ret    

c010484d <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c010484d:	55                   	push   %ebp
c010484e:	89 e5                	mov    %esp,%ebp
c0104850:	83 ec 08             	sub    $0x8,%esp
	if (flag) {
c0104853:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0104857:	74 05                	je     c010485e <__intr_restore+0x11>
		intr_enable();
c0104859:	e8 36 d8 ff ff       	call   c0102094 <intr_enable>
	}
}
c010485e:	c9                   	leave  
c010485f:	c3                   	ret    

c0104860 <lgdt>:
 * lgdt - 装载全局描述符表寄存器，reset内核中数据段代码段寄存器
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
c0104860:	55                   	push   %ebp
c0104861:	89 e5                	mov    %esp,%ebp
	asm volatile ("lgdt (%0)" :: "r" (pd));
c0104863:	8b 45 08             	mov    0x8(%ebp),%eax
c0104866:	0f 01 10             	lgdtl  (%eax)
	asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
c0104869:	b8 23 00 00 00       	mov    $0x23,%eax
c010486e:	8e e8                	mov    %eax,%gs
	asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
c0104870:	b8 23 00 00 00       	mov    $0x23,%eax
c0104875:	8e e0                	mov    %eax,%fs
	asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
c0104877:	b8 10 00 00 00       	mov    $0x10,%eax
c010487c:	8e c0                	mov    %eax,%es
	asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
c010487e:	b8 10 00 00 00       	mov    $0x10,%eax
c0104883:	8e d8                	mov    %eax,%ds
	asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
c0104885:	b8 10 00 00 00       	mov    $0x10,%eax
c010488a:	8e d0                	mov    %eax,%ss
	// reload cs
	asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c010488c:	ea 93 48 10 c0 08 00 	ljmp   $0x8,$0xc0104893
}
c0104893:	5d                   	pop    %ebp
c0104894:	c3                   	ret    

c0104895 <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
c0104895:	55                   	push   %ebp
c0104896:	89 e5                	mov    %esp,%ebp
	ts.ts_esp0 = esp0;
c0104898:	8b 45 08             	mov    0x8(%ebp),%eax
c010489b:	a3 24 ba 11 c0       	mov    %eax,0xc011ba24
}
c01048a0:	5d                   	pop    %ebp
c01048a1:	c3                   	ret    

c01048a2 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
/* 初始化默认GDT和TSS */
static void
gdt_init(void) {
c01048a2:	55                   	push   %ebp
c01048a3:	89 e5                	mov    %esp,%ebp
c01048a5:	83 ec 14             	sub    $0x14,%esp
	// set boot kernel stack and default SS0
	load_esp0((uintptr_t)bootstacktop);
c01048a8:	b8 00 a0 11 c0       	mov    $0xc011a000,%eax
c01048ad:	89 04 24             	mov    %eax,(%esp)
c01048b0:	e8 e0 ff ff ff       	call   c0104895 <load_esp0>
	ts.ts_ss0 = KERNEL_DS;
c01048b5:	66 c7 05 28 ba 11 c0 	movw   $0x10,0xc011ba28
c01048bc:	10 00 

	// initialize the TSS filed of the gdt
	gdt[SEG_TSS] = SEG16(STS_T32A, (uint32_t)&ts, sizeof(ts), DPL_KERNEL);
c01048be:	66 c7 05 88 aa 11 c0 	movw   $0x68,0xc011aa88
c01048c5:	68 00 
c01048c7:	b8 20 ba 11 c0       	mov    $0xc011ba20,%eax
c01048cc:	66 a3 8a aa 11 c0    	mov    %ax,0xc011aa8a
c01048d2:	b8 20 ba 11 c0       	mov    $0xc011ba20,%eax
c01048d7:	c1 e8 10             	shr    $0x10,%eax
c01048da:	a2 8c aa 11 c0       	mov    %al,0xc011aa8c
c01048df:	0f b6 05 8d aa 11 c0 	movzbl 0xc011aa8d,%eax
c01048e6:	83 e0 f0             	and    $0xfffffff0,%eax
c01048e9:	83 c8 09             	or     $0x9,%eax
c01048ec:	a2 8d aa 11 c0       	mov    %al,0xc011aa8d
c01048f1:	0f b6 05 8d aa 11 c0 	movzbl 0xc011aa8d,%eax
c01048f8:	83 c8 10             	or     $0x10,%eax
c01048fb:	a2 8d aa 11 c0       	mov    %al,0xc011aa8d
c0104900:	0f b6 05 8d aa 11 c0 	movzbl 0xc011aa8d,%eax
c0104907:	83 e0 9f             	and    $0xffffff9f,%eax
c010490a:	a2 8d aa 11 c0       	mov    %al,0xc011aa8d
c010490f:	0f b6 05 8d aa 11 c0 	movzbl 0xc011aa8d,%eax
c0104916:	83 c8 80             	or     $0xffffff80,%eax
c0104919:	a2 8d aa 11 c0       	mov    %al,0xc011aa8d
c010491e:	0f b6 05 8e aa 11 c0 	movzbl 0xc011aa8e,%eax
c0104925:	83 e0 f0             	and    $0xfffffff0,%eax
c0104928:	a2 8e aa 11 c0       	mov    %al,0xc011aa8e
c010492d:	0f b6 05 8e aa 11 c0 	movzbl 0xc011aa8e,%eax
c0104934:	83 e0 ef             	and    $0xffffffef,%eax
c0104937:	a2 8e aa 11 c0       	mov    %al,0xc011aa8e
c010493c:	0f b6 05 8e aa 11 c0 	movzbl 0xc011aa8e,%eax
c0104943:	83 e0 df             	and    $0xffffffdf,%eax
c0104946:	a2 8e aa 11 c0       	mov    %al,0xc011aa8e
c010494b:	0f b6 05 8e aa 11 c0 	movzbl 0xc011aa8e,%eax
c0104952:	83 c8 40             	or     $0x40,%eax
c0104955:	a2 8e aa 11 c0       	mov    %al,0xc011aa8e
c010495a:	0f b6 05 8e aa 11 c0 	movzbl 0xc011aa8e,%eax
c0104961:	83 e0 7f             	and    $0x7f,%eax
c0104964:	a2 8e aa 11 c0       	mov    %al,0xc011aa8e
c0104969:	b8 20 ba 11 c0       	mov    $0xc011ba20,%eax
c010496e:	c1 e8 18             	shr    $0x18,%eax
c0104971:	a2 8f aa 11 c0       	mov    %al,0xc011aa8f
	gdt[SEG_TSS].sd_s = 0;
c0104976:	0f b6 05 8d aa 11 c0 	movzbl 0xc011aa8d,%eax
c010497d:	83 e0 ef             	and    $0xffffffef,%eax
c0104980:	a2 8d aa 11 c0       	mov    %al,0xc011aa8d

	// reload all segment registers
	lgdt(&gdt_pd);
c0104985:	c7 04 24 90 aa 11 c0 	movl   $0xc011aa90,(%esp)
c010498c:	e8 cf fe ff ff       	call   c0104860 <lgdt>
c0104991:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
	asm volatile ("cli");
}

static inline void
ltr(uint16_t sel) {
	asm volatile ("ltr %0" :: "r" (sel));
c0104997:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c010499b:	0f 00 d8             	ltr    %ax

	// load the TSS
	ltr(GD_TSS);
}
c010499e:	c9                   	leave  
c010499f:	c3                   	ret    

c01049a0 <init_pmm_manager>:

static void
init_pmm_manager(void) {
c01049a0:	55                   	push   %ebp
c01049a1:	89 e5                	mov    %esp,%ebp
c01049a3:	83 ec 18             	sub    $0x18,%esp
	pmm_manager = &buddy_pmm_manager;
c01049a6:	c7 05 90 ba 11 c0 84 	movl   $0xc0107d84,0xc011ba90
c01049ad:	7d 10 c0 
	cprintf("memory managment: %s\n", pmm_manager->name);
c01049b0:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c01049b5:	8b 00                	mov    (%eax),%eax
c01049b7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01049bb:	c7 04 24 20 7e 10 c0 	movl   $0xc0107e20,(%esp)
c01049c2:	e8 e9 b7 ff ff       	call   c01001b0 <cprintf>
	pmm_manager->init();
c01049c7:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c01049cc:	8b 40 04             	mov    0x4(%eax),%eax
c01049cf:	ff d0                	call   *%eax
}
c01049d1:	c9                   	leave  
c01049d2:	c3                   	ret    

c01049d3 <init_memmap>:

static void
init_memmap(struct Page *base, size_t n) {
c01049d3:	55                   	push   %ebp
c01049d4:	89 e5                	mov    %esp,%ebp
c01049d6:	83 ec 18             	sub    $0x18,%esp
	pmm_manager->init_memmap(base, n);
c01049d9:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c01049de:	8b 50 08             	mov    0x8(%eax),%edx
c01049e1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01049e4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01049e8:	8b 45 08             	mov    0x8(%ebp),%eax
c01049eb:	89 04 24             	mov    %eax,(%esp)
c01049ee:	ff d2                	call   *%edx
}
c01049f0:	c9                   	leave  
c01049f1:	c3                   	ret    

c01049f2 <alloc_pages>:

struct Page *
alloc_pages(size_t n) {
c01049f2:	55                   	push   %ebp
c01049f3:	89 e5                	mov    %esp,%ebp
c01049f5:	83 ec 28             	sub    $0x28,%esp
	struct Page *page;
	bool intr_flag;
	local_intr_save(intr_flag);
c01049f8:	e8 21 fe ff ff       	call   c010481e <__intr_save>
c01049fd:	89 45 f4             	mov    %eax,-0xc(%ebp)
	{
		page = pmm_manager->alloc_pages(n);
c0104a00:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c0104a05:	8b 50 0c             	mov    0xc(%eax),%edx
c0104a08:	8b 45 08             	mov    0x8(%ebp),%eax
c0104a0b:	89 04 24             	mov    %eax,(%esp)
c0104a0e:	ff d2                	call   *%edx
c0104a10:	89 45 f0             	mov    %eax,-0x10(%ebp)
	}
	local_intr_restore(intr_flag);
c0104a13:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104a16:	89 04 24             	mov    %eax,(%esp)
c0104a19:	e8 2f fe ff ff       	call   c010484d <__intr_restore>
	return page;
c0104a1e:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0104a21:	c9                   	leave  
c0104a22:	c3                   	ret    

c0104a23 <free_pages>:

void
free_pages(struct Page *base, size_t n) {
c0104a23:	55                   	push   %ebp
c0104a24:	89 e5                	mov    %esp,%ebp
c0104a26:	83 ec 28             	sub    $0x28,%esp
	bool intr_flag;
	local_intr_save(intr_flag);
c0104a29:	e8 f0 fd ff ff       	call   c010481e <__intr_save>
c0104a2e:	89 45 f4             	mov    %eax,-0xc(%ebp)
	{
		pmm_manager->free_pages(base, n);
c0104a31:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c0104a36:	8b 50 10             	mov    0x10(%eax),%edx
c0104a39:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104a3c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104a40:	8b 45 08             	mov    0x8(%ebp),%eax
c0104a43:	89 04 24             	mov    %eax,(%esp)
c0104a46:	ff d2                	call   *%edx
	}
	local_intr_restore(intr_flag);
c0104a48:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104a4b:	89 04 24             	mov    %eax,(%esp)
c0104a4e:	e8 fa fd ff ff       	call   c010484d <__intr_restore>
}
c0104a53:	c9                   	leave  
c0104a54:	c3                   	ret    

c0104a55 <nr_free_pages>:

size_t
nr_free_pages(void) {
c0104a55:	55                   	push   %ebp
c0104a56:	89 e5                	mov    %esp,%ebp
c0104a58:	83 ec 28             	sub    $0x28,%esp
	size_t ret;
	bool intr_flag;
	local_intr_save(intr_flag);
c0104a5b:	e8 be fd ff ff       	call   c010481e <__intr_save>
c0104a60:	89 45 f4             	mov    %eax,-0xc(%ebp)
	{
		ret = pmm_manager->nr_free_pages();
c0104a63:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c0104a68:	8b 40 14             	mov    0x14(%eax),%eax
c0104a6b:	ff d0                	call   *%eax
c0104a6d:	89 45 f0             	mov    %eax,-0x10(%ebp)
	}
	local_intr_restore(intr_flag);
c0104a70:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104a73:	89 04 24             	mov    %eax,(%esp)
c0104a76:	e8 d2 fd ff ff       	call   c010484d <__intr_restore>
	return ret;
c0104a7b:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0104a7e:	c9                   	leave  
c0104a7f:	c3                   	ret    

c0104a80 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
c0104a80:	55                   	push   %ebp
c0104a81:	89 e5                	mov    %esp,%ebp
c0104a83:	57                   	push   %edi
c0104a84:	56                   	push   %esi
c0104a85:	53                   	push   %ebx
c0104a86:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
	struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c0104a8c:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
	uint64_t maxpa = 0;
c0104a93:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c0104a9a:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

	cprintf("e820map:\n");
c0104aa1:	c7 04 24 36 7e 10 c0 	movl   $0xc0107e36,(%esp)
c0104aa8:	e8 03 b7 ff ff       	call   c01001b0 <cprintf>
	int i;
	for (i = 0; i < memmap->nr_map; i ++) {
c0104aad:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0104ab4:	e9 10 01 00 00       	jmp    c0104bc9 <page_init+0x149>
		uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0104ab9:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104abc:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104abf:	89 d0                	mov    %edx,%eax
c0104ac1:	c1 e0 02             	shl    $0x2,%eax
c0104ac4:	01 d0                	add    %edx,%eax
c0104ac6:	c1 e0 02             	shl    $0x2,%eax
c0104ac9:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104acc:	8b 50 08             	mov    0x8(%eax),%edx
c0104acf:	8b 40 04             	mov    0x4(%eax),%eax
c0104ad2:	89 45 b8             	mov    %eax,-0x48(%ebp)
c0104ad5:	89 55 bc             	mov    %edx,-0x44(%ebp)
c0104ad8:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104adb:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104ade:	89 d0                	mov    %edx,%eax
c0104ae0:	c1 e0 02             	shl    $0x2,%eax
c0104ae3:	01 d0                	add    %edx,%eax
c0104ae5:	c1 e0 02             	shl    $0x2,%eax
c0104ae8:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104aeb:	8b 50 10             	mov    0x10(%eax),%edx
c0104aee:	8b 40 0c             	mov    0xc(%eax),%eax
c0104af1:	03 45 b8             	add    -0x48(%ebp),%eax
c0104af4:	13 55 bc             	adc    -0x44(%ebp),%edx
c0104af7:	89 45 b0             	mov    %eax,-0x50(%ebp)
c0104afa:	89 55 b4             	mov    %edx,-0x4c(%ebp)
		cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
				memmap->map[i].size, begin, end - 1, memmap->map[i].type);
c0104afd:	8b 4d c4             	mov    -0x3c(%ebp),%ecx

	cprintf("e820map:\n");
	int i;
	for (i = 0; i < memmap->nr_map; i ++) {
		uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
		cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c0104b00:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104b03:	89 d0                	mov    %edx,%eax
c0104b05:	c1 e0 02             	shl    $0x2,%eax
c0104b08:	01 d0                	add    %edx,%eax
c0104b0a:	c1 e0 02             	shl    $0x2,%eax
c0104b0d:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104b10:	83 c0 14             	add    $0x14,%eax
c0104b13:	8b 00                	mov    (%eax),%eax
c0104b15:	89 45 84             	mov    %eax,-0x7c(%ebp)
c0104b18:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0104b1b:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0104b1e:	89 c6                	mov    %eax,%esi
c0104b20:	89 d7                	mov    %edx,%edi
c0104b22:	83 c6 ff             	add    $0xffffffff,%esi
c0104b25:	83 d7 ff             	adc    $0xffffffff,%edi
				memmap->map[i].size, begin, end - 1, memmap->map[i].type);
c0104b28:	8b 4d c4             	mov    -0x3c(%ebp),%ecx

	cprintf("e820map:\n");
	int i;
	for (i = 0; i < memmap->nr_map; i ++) {
		uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
		cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c0104b2b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104b2e:	89 d0                	mov    %edx,%eax
c0104b30:	c1 e0 02             	shl    $0x2,%eax
c0104b33:	01 d0                	add    %edx,%eax
c0104b35:	c1 e0 02             	shl    $0x2,%eax
c0104b38:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104b3b:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104b3e:	8b 58 10             	mov    0x10(%eax),%ebx
c0104b41:	8b 45 84             	mov    -0x7c(%ebp),%eax
c0104b44:	89 44 24 1c          	mov    %eax,0x1c(%esp)
c0104b48:	89 74 24 14          	mov    %esi,0x14(%esp)
c0104b4c:	89 7c 24 18          	mov    %edi,0x18(%esp)
c0104b50:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0104b53:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0104b56:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104b5a:	89 54 24 10          	mov    %edx,0x10(%esp)
c0104b5e:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c0104b62:	89 5c 24 08          	mov    %ebx,0x8(%esp)
c0104b66:	c7 04 24 40 7e 10 c0 	movl   $0xc0107e40,(%esp)
c0104b6d:	e8 3e b6 ff ff       	call   c01001b0 <cprintf>
				memmap->map[i].size, begin, end - 1, memmap->map[i].type);
		if (memmap->map[i].type == E820_ARM) {
c0104b72:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104b75:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104b78:	89 d0                	mov    %edx,%eax
c0104b7a:	c1 e0 02             	shl    $0x2,%eax
c0104b7d:	01 d0                	add    %edx,%eax
c0104b7f:	c1 e0 02             	shl    $0x2,%eax
c0104b82:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104b85:	83 c0 14             	add    $0x14,%eax
c0104b88:	8b 00                	mov    (%eax),%eax
c0104b8a:	83 f8 01             	cmp    $0x1,%eax
c0104b8d:	75 36                	jne    c0104bc5 <page_init+0x145>
			if (maxpa < end && begin < KMEMSIZE) {
c0104b8f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104b92:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104b95:	3b 55 b4             	cmp    -0x4c(%ebp),%edx
c0104b98:	77 2b                	ja     c0104bc5 <page_init+0x145>
c0104b9a:	3b 55 b4             	cmp    -0x4c(%ebp),%edx
c0104b9d:	72 05                	jb     c0104ba4 <page_init+0x124>
c0104b9f:	3b 45 b0             	cmp    -0x50(%ebp),%eax
c0104ba2:	73 21                	jae    c0104bc5 <page_init+0x145>
c0104ba4:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
c0104ba8:	77 1b                	ja     c0104bc5 <page_init+0x145>
c0104baa:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
c0104bae:	72 09                	jb     c0104bb9 <page_init+0x139>
c0104bb0:	81 7d b8 ff ff ff 37 	cmpl   $0x37ffffff,-0x48(%ebp)
c0104bb7:	77 0c                	ja     c0104bc5 <page_init+0x145>
				maxpa = end;
c0104bb9:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0104bbc:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0104bbf:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0104bc2:	89 55 e4             	mov    %edx,-0x1c(%ebp)
	struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
	uint64_t maxpa = 0;

	cprintf("e820map:\n");
	int i;
	for (i = 0; i < memmap->nr_map; i ++) {
c0104bc5:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c0104bc9:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0104bcc:	8b 00                	mov    (%eax),%eax
c0104bce:	3b 45 dc             	cmp    -0x24(%ebp),%eax
c0104bd1:	0f 8f e2 fe ff ff    	jg     c0104ab9 <page_init+0x39>
			if (maxpa < end && begin < KMEMSIZE) {
				maxpa = end;
			}
		}
	}
	if (maxpa > KMEMSIZE) {
c0104bd7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0104bdb:	72 1d                	jb     c0104bfa <page_init+0x17a>
c0104bdd:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0104be1:	77 09                	ja     c0104bec <page_init+0x16c>
c0104be3:	81 7d e0 00 00 00 38 	cmpl   $0x38000000,-0x20(%ebp)
c0104bea:	76 0e                	jbe    c0104bfa <page_init+0x17a>
		maxpa = KMEMSIZE;
c0104bec:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
c0104bf3:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
	}

	extern char end[];

	npage = maxpa / PGSIZE;
c0104bfa:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104bfd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104c00:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104c04:	c1 ea 0c             	shr    $0xc,%edx
c0104c07:	a3 00 ba 11 c0       	mov    %eax,0xc011ba00
	pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
c0104c0c:	c7 45 ac 00 10 00 00 	movl   $0x1000,-0x54(%ebp)
c0104c13:	b8 9c ba 11 c0       	mov    $0xc011ba9c,%eax
c0104c18:	83 e8 01             	sub    $0x1,%eax
c0104c1b:	03 45 ac             	add    -0x54(%ebp),%eax
c0104c1e:	89 45 a8             	mov    %eax,-0x58(%ebp)
c0104c21:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0104c24:	ba 00 00 00 00       	mov    $0x0,%edx
c0104c29:	f7 75 ac             	divl   -0x54(%ebp)
c0104c2c:	89 d0                	mov    %edx,%eax
c0104c2e:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0104c31:	89 d1                	mov    %edx,%ecx
c0104c33:	29 c1                	sub    %eax,%ecx
c0104c35:	89 c8                	mov    %ecx,%eax
c0104c37:	a3 98 ba 11 c0       	mov    %eax,0xc011ba98

	for (i = 0; i < npage; i ++) {
c0104c3c:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0104c43:	eb 2f                	jmp    c0104c74 <page_init+0x1f4>
		SetPageReserved(pages + i);
c0104c45:	8b 0d 98 ba 11 c0    	mov    0xc011ba98,%ecx
c0104c4b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104c4e:	89 d0                	mov    %edx,%eax
c0104c50:	01 c0                	add    %eax,%eax
c0104c52:	01 d0                	add    %edx,%eax
c0104c54:	c1 e0 03             	shl    $0x3,%eax
c0104c57:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104c5a:	83 c0 04             	add    $0x4,%eax
c0104c5d:	c7 45 90 00 00 00 00 	movl   $0x0,-0x70(%ebp)
c0104c64:	89 45 8c             	mov    %eax,-0x74(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
	asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0104c67:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0104c6a:	8b 55 90             	mov    -0x70(%ebp),%edx
c0104c6d:	0f ab 10             	bts    %edx,(%eax)
	extern char end[];

	npage = maxpa / PGSIZE;
	pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);

	for (i = 0; i < npage; i ++) {
c0104c70:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c0104c74:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104c77:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0104c7c:	39 c2                	cmp    %eax,%edx
c0104c7e:	72 c5                	jb     c0104c45 <page_init+0x1c5>
		SetPageReserved(pages + i);
	}

	uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
c0104c80:	8b 15 00 ba 11 c0    	mov    0xc011ba00,%edx
c0104c86:	89 d0                	mov    %edx,%eax
c0104c88:	01 c0                	add    %eax,%eax
c0104c8a:	01 d0                	add    %edx,%eax
c0104c8c:	c1 e0 03             	shl    $0x3,%eax
c0104c8f:	89 c2                	mov    %eax,%edx
c0104c91:	a1 98 ba 11 c0       	mov    0xc011ba98,%eax
c0104c96:	8d 04 02             	lea    (%edx,%eax,1),%eax
c0104c99:	89 45 a4             	mov    %eax,-0x5c(%ebp)
c0104c9c:	81 7d a4 ff ff ff bf 	cmpl   $0xbfffffff,-0x5c(%ebp)
c0104ca3:	77 23                	ja     c0104cc8 <page_init+0x248>
c0104ca5:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0104ca8:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104cac:	c7 44 24 08 70 7e 10 	movl   $0xc0107e70,0x8(%esp)
c0104cb3:	c0 
c0104cb4:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c0104cbb:	00 
c0104cbc:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0104cc3:	e8 3c c9 ff ff       	call   c0101604 <__panic>
c0104cc8:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0104ccb:	05 00 00 00 40       	add    $0x40000000,%eax
c0104cd0:	89 45 a0             	mov    %eax,-0x60(%ebp)

	for (i = 0; i < memmap->nr_map; i ++) {
c0104cd3:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0104cda:	e9 80 01 00 00       	jmp    c0104e5f <page_init+0x3df>
		uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0104cdf:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104ce2:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104ce5:	89 d0                	mov    %edx,%eax
c0104ce7:	c1 e0 02             	shl    $0x2,%eax
c0104cea:	01 d0                	add    %edx,%eax
c0104cec:	c1 e0 02             	shl    $0x2,%eax
c0104cef:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104cf2:	8b 50 08             	mov    0x8(%eax),%edx
c0104cf5:	8b 40 04             	mov    0x4(%eax),%eax
c0104cf8:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104cfb:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0104cfe:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104d01:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104d04:	89 d0                	mov    %edx,%eax
c0104d06:	c1 e0 02             	shl    $0x2,%eax
c0104d09:	01 d0                	add    %edx,%eax
c0104d0b:	c1 e0 02             	shl    $0x2,%eax
c0104d0e:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104d11:	8b 50 10             	mov    0x10(%eax),%edx
c0104d14:	8b 40 0c             	mov    0xc(%eax),%eax
c0104d17:	03 45 d0             	add    -0x30(%ebp),%eax
c0104d1a:	13 55 d4             	adc    -0x2c(%ebp),%edx
c0104d1d:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0104d20:	89 55 cc             	mov    %edx,-0x34(%ebp)
		if (memmap->map[i].type == E820_ARM) {
c0104d23:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104d26:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104d29:	89 d0                	mov    %edx,%eax
c0104d2b:	c1 e0 02             	shl    $0x2,%eax
c0104d2e:	01 d0                	add    %edx,%eax
c0104d30:	c1 e0 02             	shl    $0x2,%eax
c0104d33:	8d 04 01             	lea    (%ecx,%eax,1),%eax
c0104d36:	83 c0 14             	add    $0x14,%eax
c0104d39:	8b 00                	mov    (%eax),%eax
c0104d3b:	83 f8 01             	cmp    $0x1,%eax
c0104d3e:	0f 85 17 01 00 00    	jne    c0104e5b <page_init+0x3db>
			if (begin < freemem) {
c0104d44:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104d47:	ba 00 00 00 00       	mov    $0x0,%edx
c0104d4c:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c0104d4f:	72 18                	jb     c0104d69 <page_init+0x2e9>
c0104d51:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c0104d54:	77 05                	ja     c0104d5b <page_init+0x2db>
c0104d56:	3b 45 d0             	cmp    -0x30(%ebp),%eax
c0104d59:	76 0e                	jbe    c0104d69 <page_init+0x2e9>
				begin = freemem;
c0104d5b:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104d5e:	ba 00 00 00 00       	mov    $0x0,%edx
c0104d63:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104d66:	89 55 d4             	mov    %edx,-0x2c(%ebp)
			}
			if (end > KMEMSIZE) {
c0104d69:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
c0104d6d:	72 1d                	jb     c0104d8c <page_init+0x30c>
c0104d6f:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
c0104d73:	77 09                	ja     c0104d7e <page_init+0x2fe>
c0104d75:	81 7d c8 00 00 00 38 	cmpl   $0x38000000,-0x38(%ebp)
c0104d7c:	76 0e                	jbe    c0104d8c <page_init+0x30c>
				end = KMEMSIZE;
c0104d7e:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c0104d85:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
			}
			if (begin < end) {
c0104d8c:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104d8f:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104d92:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c0104d95:	0f 87 c0 00 00 00    	ja     c0104e5b <page_init+0x3db>
c0104d9b:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c0104d9e:	72 09                	jb     c0104da9 <page_init+0x329>
c0104da0:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0104da3:	0f 83 b2 00 00 00    	jae    c0104e5b <page_init+0x3db>
				begin = ROUNDUP(begin, PGSIZE);
c0104da9:	c7 45 9c 00 10 00 00 	movl   $0x1000,-0x64(%ebp)
c0104db0:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104db3:	03 45 9c             	add    -0x64(%ebp),%eax
c0104db6:	83 e8 01             	sub    $0x1,%eax
c0104db9:	89 45 98             	mov    %eax,-0x68(%ebp)
c0104dbc:	8b 45 98             	mov    -0x68(%ebp),%eax
c0104dbf:	ba 00 00 00 00       	mov    $0x0,%edx
c0104dc4:	f7 75 9c             	divl   -0x64(%ebp)
c0104dc7:	89 d0                	mov    %edx,%eax
c0104dc9:	8b 55 98             	mov    -0x68(%ebp),%edx
c0104dcc:	89 d1                	mov    %edx,%ecx
c0104dce:	29 c1                	sub    %eax,%ecx
c0104dd0:	89 c8                	mov    %ecx,%eax
c0104dd2:	ba 00 00 00 00       	mov    $0x0,%edx
c0104dd7:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104dda:	89 55 d4             	mov    %edx,-0x2c(%ebp)
				end = ROUNDDOWN(end, PGSIZE);
c0104ddd:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104de0:	89 45 94             	mov    %eax,-0x6c(%ebp)
c0104de3:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0104de6:	ba 00 00 00 00       	mov    $0x0,%edx
c0104deb:	89 c1                	mov    %eax,%ecx
c0104ded:	81 e1 00 f0 ff ff    	and    $0xfffff000,%ecx
c0104df3:	89 8d 78 ff ff ff    	mov    %ecx,-0x88(%ebp)
c0104df9:	89 d1                	mov    %edx,%ecx
c0104dfb:	83 e1 00             	and    $0x0,%ecx
c0104dfe:	89 8d 7c ff ff ff    	mov    %ecx,-0x84(%ebp)
c0104e04:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
c0104e0a:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
c0104e10:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0104e13:	89 55 cc             	mov    %edx,-0x34(%ebp)
				if (begin < end) {
c0104e16:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104e19:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104e1c:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c0104e1f:	77 3a                	ja     c0104e5b <page_init+0x3db>
c0104e21:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c0104e24:	72 05                	jb     c0104e2b <page_init+0x3ab>
c0104e26:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0104e29:	73 30                	jae    c0104e5b <page_init+0x3db>
					init_memmap(pa2page(begin), (end - begin) / PGSIZE);
c0104e2b:	8b 4d d0             	mov    -0x30(%ebp),%ecx
c0104e2e:	8b 5d d4             	mov    -0x2c(%ebp),%ebx
c0104e31:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104e34:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0104e37:	29 c8                	sub    %ecx,%eax
c0104e39:	19 da                	sbb    %ebx,%edx
c0104e3b:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104e3f:	c1 ea 0c             	shr    $0xc,%edx
c0104e42:	89 c3                	mov    %eax,%ebx
c0104e44:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104e47:	89 04 24             	mov    %eax,(%esp)
c0104e4a:	e8 3b f8 ff ff       	call   c010468a <pa2page>
c0104e4f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0104e53:	89 04 24             	mov    %eax,(%esp)
c0104e56:	e8 78 fb ff ff       	call   c01049d3 <init_memmap>
		SetPageReserved(pages + i);
	}

	uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);

	for (i = 0; i < memmap->nr_map; i ++) {
c0104e5b:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c0104e5f:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0104e62:	8b 00                	mov    (%eax),%eax
c0104e64:	3b 45 dc             	cmp    -0x24(%ebp),%eax
c0104e67:	0f 8f 72 fe ff ff    	jg     c0104cdf <page_init+0x25f>
					init_memmap(pa2page(begin), (end - begin) / PGSIZE);
				}
			}
		}
	}
}
c0104e6d:	81 c4 9c 00 00 00    	add    $0x9c,%esp
c0104e73:	5b                   	pop    %ebx
c0104e74:	5e                   	pop    %esi
c0104e75:	5f                   	pop    %edi
c0104e76:	5d                   	pop    %ebp
c0104e77:	c3                   	ret    

c0104e78 <enable_paging>:

static void
enable_paging(void) {
c0104e78:	55                   	push   %ebp
c0104e79:	89 e5                	mov    %esp,%ebp
c0104e7b:	53                   	push   %ebx
c0104e7c:	83 ec 10             	sub    $0x10,%esp
	lcr3(boot_cr3);
c0104e7f:	a1 94 ba 11 c0       	mov    0xc011ba94,%eax
c0104e84:	89 45 f4             	mov    %eax,-0xc(%ebp)
	asm volatile ("movl %0, %%cr0" :: "r" (val));
}

static inline void
lcr3(uint32_t val) {
	asm volatile ("movl %0, %%cr3" :: "r" (val));
c0104e87:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104e8a:	0f 22 d8             	mov    %eax,%cr3
}

static inline uint32_t
rcr0(void) {
	uint32_t val;
	asm volatile ("movl %%cr0, %0" : "=r" (val));
c0104e8d:	0f 20 c3             	mov    %cr0,%ebx
c0104e90:	89 5d f0             	mov    %ebx,-0x10(%ebp)
	return val;
c0104e93:	8b 45 f0             	mov    -0x10(%ebp),%eax

	// turn on paging
	uint32_t cr0 = rcr0();
c0104e96:	89 45 f8             	mov    %eax,-0x8(%ebp)
	cr0 |= CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP;
c0104e99:	81 4d f8 2f 00 05 80 	orl    $0x8005002f,-0x8(%ebp)
	cr0 &= ~(CR0_TS | CR0_EM);
c0104ea0:	83 65 f8 f3          	andl   $0xfffffff3,-0x8(%ebp)
c0104ea4:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0104ea7:	89 45 ec             	mov    %eax,-0x14(%ebp)
	asm volatile ("pushl %0; popfl" :: "r" (eflags));
}

static inline void
lcr0(uint32_t val) {
	asm volatile ("movl %0, %%cr0" :: "r" (val));
c0104eaa:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ead:	0f 22 c0             	mov    %eax,%cr0
	lcr0(cr0);
}
c0104eb0:	83 c4 10             	add    $0x10,%esp
c0104eb3:	5b                   	pop    %ebx
c0104eb4:	5d                   	pop    %ebp
c0104eb5:	c3                   	ret    

c0104eb6 <boot_map_segment>:

static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c0104eb6:	55                   	push   %ebp
c0104eb7:	89 e5                	mov    %esp,%ebp
c0104eb9:	83 ec 38             	sub    $0x38,%esp
	assert(PGOFF(la) == PGOFF(pa));
c0104ebc:	8b 45 14             	mov    0x14(%ebp),%eax
c0104ebf:	8b 55 0c             	mov    0xc(%ebp),%edx
c0104ec2:	31 d0                	xor    %edx,%eax
c0104ec4:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104ec9:	85 c0                	test   %eax,%eax
c0104ecb:	74 24                	je     c0104ef1 <boot_map_segment+0x3b>
c0104ecd:	c7 44 24 0c a2 7e 10 	movl   $0xc0107ea2,0xc(%esp)
c0104ed4:	c0 
c0104ed5:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0104edc:	c0 
c0104edd:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
c0104ee4:	00 
c0104ee5:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0104eec:	e8 13 c7 ff ff       	call   c0101604 <__panic>
	uint32_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c0104ef1:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
c0104ef8:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104efb:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104f00:	03 45 10             	add    0x10(%ebp),%eax
c0104f03:	03 45 f0             	add    -0x10(%ebp),%eax
c0104f06:	83 e8 01             	sub    $0x1,%eax
c0104f09:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104f0c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104f0f:	ba 00 00 00 00       	mov    $0x0,%edx
c0104f14:	f7 75 f0             	divl   -0x10(%ebp)
c0104f17:	89 d0                	mov    %edx,%eax
c0104f19:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0104f1c:	89 d1                	mov    %edx,%ecx
c0104f1e:	29 c1                	sub    %eax,%ecx
c0104f20:	89 c8                	mov    %ecx,%eax
c0104f22:	c1 e8 0c             	shr    $0xc,%eax
c0104f25:	89 45 f4             	mov    %eax,-0xc(%ebp)
	la = ROUNDDOWN(la, PGSIZE);
c0104f28:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104f2b:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104f2e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104f31:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104f36:	89 45 0c             	mov    %eax,0xc(%ebp)
	pa = ROUNDDOWN(pa, PGSIZE);
c0104f39:	8b 45 14             	mov    0x14(%ebp),%eax
c0104f3c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0104f3f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f42:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104f47:	89 45 14             	mov    %eax,0x14(%ebp)
	for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104f4a:	eb 6b                	jmp    c0104fb7 <boot_map_segment+0x101>
		pte_t *ptep = get_pte(pgdir, la, 1);
c0104f4c:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104f53:	00 
c0104f54:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104f57:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104f5b:	8b 45 08             	mov    0x8(%ebp),%eax
c0104f5e:	89 04 24             	mov    %eax,(%esp)
c0104f61:	e8 ce 01 00 00       	call   c0105134 <get_pte>
c0104f66:	89 45 e0             	mov    %eax,-0x20(%ebp)
		assert(ptep != NULL);
c0104f69:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0104f6d:	75 24                	jne    c0104f93 <boot_map_segment+0xdd>
c0104f6f:	c7 44 24 0c ce 7e 10 	movl   $0xc0107ece,0xc(%esp)
c0104f76:	c0 
c0104f77:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0104f7e:	c0 
c0104f7f:	c7 44 24 04 23 01 00 	movl   $0x123,0x4(%esp)
c0104f86:	00 
c0104f87:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0104f8e:	e8 71 c6 ff ff       	call   c0101604 <__panic>
		*ptep = pa | PTE_P | perm;
c0104f93:	8b 45 18             	mov    0x18(%ebp),%eax
c0104f96:	8b 55 14             	mov    0x14(%ebp),%edx
c0104f99:	09 d0                	or     %edx,%eax
c0104f9b:	89 c2                	mov    %eax,%edx
c0104f9d:	83 ca 01             	or     $0x1,%edx
c0104fa0:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104fa3:	89 10                	mov    %edx,(%eax)
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
	assert(PGOFF(la) == PGOFF(pa));
	uint32_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
	la = ROUNDDOWN(la, PGSIZE);
	pa = ROUNDDOWN(pa, PGSIZE);
	for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104fa5:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c0104fa9:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c0104fb0:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c0104fb7:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104fbb:	75 8f                	jne    c0104f4c <boot_map_segment+0x96>
		pte_t *ptep = get_pte(pgdir, la, 1);
		assert(ptep != NULL);
		*ptep = pa | PTE_P | perm;
	}
}
c0104fbd:	c9                   	leave  
c0104fbe:	c3                   	ret    

c0104fbf <boot_alloc_page>:

static void *
boot_alloc_page(void) {
c0104fbf:	55                   	push   %ebp
c0104fc0:	89 e5                	mov    %esp,%ebp
c0104fc2:	83 ec 28             	sub    $0x28,%esp
	struct Page *p = alloc_page();
c0104fc5:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104fcc:	e8 21 fa ff ff       	call   c01049f2 <alloc_pages>
c0104fd1:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (p == NULL) {
c0104fd4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104fd8:	75 1c                	jne    c0104ff6 <boot_alloc_page+0x37>
		panic("boot_alloc_page failed.\n");
c0104fda:	c7 44 24 08 db 7e 10 	movl   $0xc0107edb,0x8(%esp)
c0104fe1:	c0 
c0104fe2:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
c0104fe9:	00 
c0104fea:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0104ff1:	e8 0e c6 ff ff       	call   c0101604 <__panic>
	}
	return page2kva(p);
c0104ff6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104ff9:	89 04 24             	mov    %eax,(%esp)
c0104ffc:	e8 d8 f6 ff ff       	call   c01046d9 <page2kva>
}
c0105001:	c9                   	leave  
c0105002:	c3                   	ret    

c0105003 <pmm_init>:

void
pmm_init(void) {
c0105003:	55                   	push   %ebp
c0105004:	89 e5                	mov    %esp,%ebp
c0105006:	83 ec 38             	sub    $0x38,%esp
	init_pmm_manager();
c0105009:	e8 92 f9 ff ff       	call   c01049a0 <init_pmm_manager>

	// detect physical memory and create free page list
	page_init();
c010500e:	e8 6d fa ff ff       	call   c0104a80 <page_init>

	check_alloc_page();
c0105013:	e8 de 04 00 00       	call   c01054f6 <check_alloc_page>

	// create initial page directory,
	boot_pgdir = boot_alloc_page();
c0105018:	e8 a2 ff ff ff       	call   c0104fbf <boot_alloc_page>
c010501d:	a3 04 ba 11 c0       	mov    %eax,0xc011ba04
	memset(boot_pgdir, 0, PGSIZE);
c0105022:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105027:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c010502e:	00 
c010502f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0105036:	00 
c0105037:	89 04 24             	mov    %eax,(%esp)
c010503a:	e8 c4 1b 00 00       	call   c0106c03 <memset>
	boot_cr3 = PADDR(boot_pgdir);
c010503f:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105044:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105047:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c010504e:	77 23                	ja     c0105073 <pmm_init+0x70>
c0105050:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105053:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105057:	c7 44 24 08 70 7e 10 	movl   $0xc0107e70,0x8(%esp)
c010505e:	c0 
c010505f:	c7 44 24 04 3d 01 00 	movl   $0x13d,0x4(%esp)
c0105066:	00 
c0105067:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c010506e:	e8 91 c5 ff ff       	call   c0101604 <__panic>
c0105073:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105076:	05 00 00 00 40       	add    $0x40000000,%eax
c010507b:	a3 94 ba 11 c0       	mov    %eax,0xc011ba94

	check_pgdir();
c0105080:	e8 8f 04 00 00       	call   c0105514 <check_pgdir>

	static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

	// recursively insert boot_pgdir in itself
	// to form a virtual page table at virtual address VPT
	boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
c0105085:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c010508a:	8d 90 ac 0f 00 00    	lea    0xfac(%eax),%edx
c0105090:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105095:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105098:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010509f:	77 23                	ja     c01050c4 <pmm_init+0xc1>
c01050a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01050a4:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01050a8:	c7 44 24 08 70 7e 10 	movl   $0xc0107e70,0x8(%esp)
c01050af:	c0 
c01050b0:	c7 44 24 04 45 01 00 	movl   $0x145,0x4(%esp)
c01050b7:	00 
c01050b8:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01050bf:	e8 40 c5 ff ff       	call   c0101604 <__panic>
c01050c4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01050c7:	05 00 00 00 40       	add    $0x40000000,%eax
c01050cc:	83 c8 03             	or     $0x3,%eax
c01050cf:	89 02                	mov    %eax,(%edx)

	// map all physical memory at KERNBASE
	boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
c01050d1:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c01050d6:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
c01050dd:	00 
c01050de:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c01050e5:	00 
c01050e6:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
c01050ed:	38 
c01050ee:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
c01050f5:	c0 
c01050f6:	89 04 24             	mov    %eax,(%esp)
c01050f9:	e8 b8 fd ff ff       	call   c0104eb6 <boot_map_segment>

	boot_pgdir[0] = boot_pgdir[PDX(KERNBASE)];
c01050fe:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105103:	8b 15 04 ba 11 c0    	mov    0xc011ba04,%edx
c0105109:	81 c2 00 0c 00 00    	add    $0xc00,%edx
c010510f:	8b 12                	mov    (%edx),%edx
c0105111:	89 10                	mov    %edx,(%eax)

	enable_paging();
c0105113:	e8 60 fd ff ff       	call   c0104e78 <enable_paging>

	gdt_init();
c0105118:	e8 85 f7 ff ff       	call   c01048a2 <gdt_init>

	boot_pgdir[0] = 0;
c010511d:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105122:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

	check_boot_pgdir();
c0105128:	e8 82 0a 00 00       	call   c0105baf <check_boot_pgdir>

	print_pgdir();
c010512d:	e8 f1 0e 00 00       	call   c0106023 <print_pgdir>
}
c0105132:	c9                   	leave  
c0105133:	c3                   	ret    

c0105134 <get_pte>:

pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c0105134:	55                   	push   %ebp
c0105135:	89 e5                	mov    %esp,%ebp
c0105137:	83 ec 48             	sub    $0x48,%esp
	 * please read pmm.h for useful macros
	 *
	 * Task1
	 */
	 //Find the pde of la
	pde_t *pdep = &pgdir[PDX(la)];
c010513a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010513d:	c1 e8 16             	shr    $0x16,%eax
c0105140:	c1 e0 02             	shl    $0x2,%eax
c0105143:	03 45 08             	add    0x8(%ebp),%eax
c0105146:	89 45 f4             	mov    %eax,-0xc(%ebp)

	//The Permission
	if(*pdep & PTE_P) 
c0105149:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010514c:	8b 00                	mov    (%eax),%eax
c010514e:	83 e0 01             	and    $0x1,%eax
c0105151:	84 c0                	test   %al,%al
c0105153:	74 61                	je     c01051b6 <get_pte+0x82>
		return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)];
c0105155:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105158:	8b 00                	mov    (%eax),%eax
c010515a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010515f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105162:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105165:	c1 e8 0c             	shr    $0xc,%eax
c0105168:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010516b:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0105170:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0105173:	72 23                	jb     c0105198 <get_pte+0x64>
c0105175:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105178:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010517c:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c0105183:	c0 
c0105184:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
c010518b:	00 
c010518c:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105193:	e8 6c c4 ff ff       	call   c0101604 <__panic>
c0105198:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010519b:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01051a0:	8b 55 0c             	mov    0xc(%ebp),%edx
c01051a3:	c1 ea 0c             	shr    $0xc,%edx
c01051a6:	81 e2 ff 03 00 00    	and    $0x3ff,%edx
c01051ac:	c1 e2 02             	shl    $0x2,%edx
c01051af:	01 d0                	add    %edx,%eax
c01051b1:	e9 16 01 00 00       	jmp    c01052cc <get_pte+0x198>
	else {
		if(create == 1) {
c01051b6:	83 7d 10 01          	cmpl   $0x1,0x10(%ebp)
c01051ba:	0f 85 07 01 00 00    	jne    c01052c7 <get_pte+0x193>
			struct Page *page = alloc_page();
c01051c0:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01051c7:	e8 26 f8 ff ff       	call   c01049f2 <alloc_pages>
c01051cc:	89 45 e8             	mov    %eax,-0x18(%ebp)
			//Important!!!
			if(page == NULL)
c01051cf:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01051d3:	75 0a                	jne    c01051df <get_pte+0xab>
				return NULL;
c01051d5:	b8 00 00 00 00       	mov    $0x0,%eax
c01051da:	e9 ed 00 00 00       	jmp    c01052cc <get_pte+0x198>
			else {
				set_page_ref(page, 1);
c01051df:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01051e6:	00 
c01051e7:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01051ea:	89 04 24             	mov    %eax,(%esp)
c01051ed:	e8 8c f5 ff ff       	call   c010477e <set_page_ref>
				uintptr_t pa = page2pa(page);
c01051f2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01051f5:	89 04 24             	mov    %eax,(%esp)
c01051f8:	e8 77 f4 ff ff       	call   c0104674 <page2pa>
c01051fd:	89 45 e4             	mov    %eax,-0x1c(%ebp)
				memset(KADDR(pa), 0, PGSIZE);
c0105200:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105203:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105206:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105209:	c1 e8 0c             	shr    $0xc,%eax
c010520c:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010520f:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0105214:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0105217:	72 23                	jb     c010523c <get_pte+0x108>
c0105219:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010521c:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105220:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c0105227:	c0 
c0105228:	c7 44 24 04 6f 01 00 	movl   $0x16f,0x4(%esp)
c010522f:	00 
c0105230:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105237:	e8 c8 c3 ff ff       	call   c0101604 <__panic>
c010523c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010523f:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0105244:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c010524b:	00 
c010524c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0105253:	00 
c0105254:	89 04 24             	mov    %eax,(%esp)
c0105257:	e8 a7 19 00 00       	call   c0106c03 <memset>
				*pdep = pa | PTE_U | PTE_W | PTE_P;
c010525c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010525f:	89 c2                	mov    %eax,%edx
c0105261:	83 ca 07             	or     $0x7,%edx
c0105264:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105267:	89 10                	mov    %edx,(%eax)
				return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)];
c0105269:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010526c:	8b 00                	mov    (%eax),%eax
c010526e:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0105273:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0105276:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105279:	c1 e8 0c             	shr    $0xc,%eax
c010527c:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c010527f:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0105284:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
c0105287:	72 23                	jb     c01052ac <get_pte+0x178>
c0105289:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010528c:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105290:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c0105297:	c0 
c0105298:	c7 44 24 04 71 01 00 	movl   $0x171,0x4(%esp)
c010529f:	00 
c01052a0:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01052a7:	e8 58 c3 ff ff       	call   c0101604 <__panic>
c01052ac:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01052af:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01052b4:	8b 55 0c             	mov    0xc(%ebp),%edx
c01052b7:	c1 ea 0c             	shr    $0xc,%edx
c01052ba:	81 e2 ff 03 00 00    	and    $0x3ff,%edx
c01052c0:	c1 e2 02             	shl    $0x2,%edx
c01052c3:	01 d0                	add    %edx,%eax
c01052c5:	eb 05                	jmp    c01052cc <get_pte+0x198>
			}
		}
		else
			return NULL;
c01052c7:	b8 00 00 00 00       	mov    $0x0,%eax
	}
}
c01052cc:	c9                   	leave  
c01052cd:	c3                   	ret    

c01052ce <get_page>:

struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c01052ce:	55                   	push   %ebp
c01052cf:	89 e5                	mov    %esp,%ebp
c01052d1:	83 ec 28             	sub    $0x28,%esp
	pte_t *ptep = get_pte(pgdir, la, 0);
c01052d4:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01052db:	00 
c01052dc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01052df:	89 44 24 04          	mov    %eax,0x4(%esp)
c01052e3:	8b 45 08             	mov    0x8(%ebp),%eax
c01052e6:	89 04 24             	mov    %eax,(%esp)
c01052e9:	e8 46 fe ff ff       	call   c0105134 <get_pte>
c01052ee:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (ptep_store != NULL) {
c01052f1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01052f5:	74 08                	je     c01052ff <get_page+0x31>
		*ptep_store = ptep;
c01052f7:	8b 45 10             	mov    0x10(%ebp),%eax
c01052fa:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01052fd:	89 10                	mov    %edx,(%eax)
	}
	if (ptep != NULL && *ptep & PTE_P) {
c01052ff:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105303:	74 1b                	je     c0105320 <get_page+0x52>
c0105305:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105308:	8b 00                	mov    (%eax),%eax
c010530a:	83 e0 01             	and    $0x1,%eax
c010530d:	84 c0                	test   %al,%al
c010530f:	74 0f                	je     c0105320 <get_page+0x52>
		return pa2page(*ptep);
c0105311:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105314:	8b 00                	mov    (%eax),%eax
c0105316:	89 04 24             	mov    %eax,(%esp)
c0105319:	e8 6c f3 ff ff       	call   c010468a <pa2page>
c010531e:	eb 05                	jmp    c0105325 <get_page+0x57>
	}
	return NULL;
c0105320:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105325:	c9                   	leave  
c0105326:	c3                   	ret    

c0105327 <page_remove_pte>:

static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c0105327:	55                   	push   %ebp
c0105328:	89 e5                	mov    %esp,%ebp
c010532a:	83 ec 28             	sub    $0x28,%esp
	 * please check if ptep is valid
	 * tlb must be manually updated if mapping is updated
	 *
	 * Task2
	 */
	 if (*ptep & PTE_P) {
c010532d:	8b 45 10             	mov    0x10(%ebp),%eax
c0105330:	8b 00                	mov    (%eax),%eax
c0105332:	83 e0 01             	and    $0x1,%eax
c0105335:	84 c0                	test   %al,%al
c0105337:	74 5c                	je     c0105395 <page_remove_pte+0x6e>
		struct Page *p = pte2page(*ptep);
c0105339:	8b 45 10             	mov    0x10(%ebp),%eax
c010533c:	8b 00                	mov    (%eax),%eax
c010533e:	89 04 24             	mov    %eax,(%esp)
c0105341:	e8 e7 f3 ff ff       	call   c010472d <pte2page>
c0105346:	89 45 f4             	mov    %eax,-0xc(%ebp)
		// If the Ref of Page >= 0 then decrease
		// If the Ref == 0,then free the Page
		if (page_ref(p) >= 0 && page_ref_dec(p) == 0)
c0105349:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010534c:	89 04 24             	mov    %eax,(%esp)
c010534f:	e8 17 f4 ff ff       	call   c010476b <page_ref>
c0105354:	85 c0                	test   %eax,%eax
c0105356:	78 22                	js     c010537a <page_remove_pte+0x53>
c0105358:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010535b:	89 04 24             	mov    %eax,(%esp)
c010535e:	e8 71 f4 ff ff       	call   c01047d4 <page_ref_dec>
c0105363:	85 c0                	test   %eax,%eax
c0105365:	75 13                	jne    c010537a <page_remove_pte+0x53>
			free_page(p);
c0105367:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010536e:	00 
c010536f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105372:	89 04 24             	mov    %eax,(%esp)
c0105375:	e8 a9 f6 ff ff       	call   c0104a23 <free_pages>
		*ptep = 0;
c010537a:	8b 45 10             	mov    0x10(%ebp),%eax
c010537d:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
		tlb_invalidate(pgdir, la);
c0105383:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105386:	89 44 24 04          	mov    %eax,0x4(%esp)
c010538a:	8b 45 08             	mov    0x8(%ebp),%eax
c010538d:	89 04 24             	mov    %eax,(%esp)
c0105390:	e8 ff 00 00 00       	call   c0105494 <tlb_invalidate>
	 }
}
c0105395:	c9                   	leave  
c0105396:	c3                   	ret    

c0105397 <page_remove>:

void
page_remove(pde_t *pgdir, uintptr_t la) {
c0105397:	55                   	push   %ebp
c0105398:	89 e5                	mov    %esp,%ebp
c010539a:	83 ec 28             	sub    $0x28,%esp
	pte_t *ptep = get_pte(pgdir, la, 0);
c010539d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01053a4:	00 
c01053a5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01053a8:	89 44 24 04          	mov    %eax,0x4(%esp)
c01053ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01053af:	89 04 24             	mov    %eax,(%esp)
c01053b2:	e8 7d fd ff ff       	call   c0105134 <get_pte>
c01053b7:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (ptep != NULL) {
c01053ba:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01053be:	74 19                	je     c01053d9 <page_remove+0x42>
		page_remove_pte(pgdir, la, ptep);
c01053c0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01053c3:	89 44 24 08          	mov    %eax,0x8(%esp)
c01053c7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01053ca:	89 44 24 04          	mov    %eax,0x4(%esp)
c01053ce:	8b 45 08             	mov    0x8(%ebp),%eax
c01053d1:	89 04 24             	mov    %eax,(%esp)
c01053d4:	e8 4e ff ff ff       	call   c0105327 <page_remove_pte>
	}
}
c01053d9:	c9                   	leave  
c01053da:	c3                   	ret    

c01053db <page_insert>:

int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c01053db:	55                   	push   %ebp
c01053dc:	89 e5                	mov    %esp,%ebp
c01053de:	83 ec 28             	sub    $0x28,%esp
	pte_t *ptep = get_pte(pgdir, la, 1);
c01053e1:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c01053e8:	00 
c01053e9:	8b 45 10             	mov    0x10(%ebp),%eax
c01053ec:	89 44 24 04          	mov    %eax,0x4(%esp)
c01053f0:	8b 45 08             	mov    0x8(%ebp),%eax
c01053f3:	89 04 24             	mov    %eax,(%esp)
c01053f6:	e8 39 fd ff ff       	call   c0105134 <get_pte>
c01053fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (ptep == NULL) {
c01053fe:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105402:	75 0a                	jne    c010540e <page_insert+0x33>
		return -E_NO_MEM;
c0105404:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c0105409:	e9 84 00 00 00       	jmp    c0105492 <page_insert+0xb7>
	}
	page_ref_inc(page);
c010540e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105411:	89 04 24             	mov    %eax,(%esp)
c0105414:	e8 81 f3 ff ff       	call   c010479a <page_ref_inc>
	if (*ptep & PTE_P) {
c0105419:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010541c:	8b 00                	mov    (%eax),%eax
c010541e:	83 e0 01             	and    $0x1,%eax
c0105421:	84 c0                	test   %al,%al
c0105423:	74 3e                	je     c0105463 <page_insert+0x88>
		struct Page *p = pte2page(*ptep);
c0105425:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105428:	8b 00                	mov    (%eax),%eax
c010542a:	89 04 24             	mov    %eax,(%esp)
c010542d:	e8 fb f2 ff ff       	call   c010472d <pte2page>
c0105432:	89 45 f0             	mov    %eax,-0x10(%ebp)
		if (p == page) {
c0105435:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105438:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010543b:	75 0d                	jne    c010544a <page_insert+0x6f>
			page_ref_dec(page);
c010543d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105440:	89 04 24             	mov    %eax,(%esp)
c0105443:	e8 8c f3 ff ff       	call   c01047d4 <page_ref_dec>
c0105448:	eb 19                	jmp    c0105463 <page_insert+0x88>
		}
		else {
			page_remove_pte(pgdir, la, ptep);
c010544a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010544d:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105451:	8b 45 10             	mov    0x10(%ebp),%eax
c0105454:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105458:	8b 45 08             	mov    0x8(%ebp),%eax
c010545b:	89 04 24             	mov    %eax,(%esp)
c010545e:	e8 c4 fe ff ff       	call   c0105327 <page_remove_pte>
		}
	}
	*ptep = page2pa(page) | PTE_P | perm;
c0105463:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105466:	89 04 24             	mov    %eax,(%esp)
c0105469:	e8 06 f2 ff ff       	call   c0104674 <page2pa>
c010546e:	0b 45 14             	or     0x14(%ebp),%eax
c0105471:	89 c2                	mov    %eax,%edx
c0105473:	83 ca 01             	or     $0x1,%edx
c0105476:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105479:	89 10                	mov    %edx,(%eax)
	tlb_invalidate(pgdir, la);
c010547b:	8b 45 10             	mov    0x10(%ebp),%eax
c010547e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105482:	8b 45 08             	mov    0x8(%ebp),%eax
c0105485:	89 04 24             	mov    %eax,(%esp)
c0105488:	e8 07 00 00 00       	call   c0105494 <tlb_invalidate>
	return 0;
c010548d:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105492:	c9                   	leave  
c0105493:	c3                   	ret    

c0105494 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c0105494:	55                   	push   %ebp
c0105495:	89 e5                	mov    %esp,%ebp
c0105497:	53                   	push   %ebx
c0105498:	83 ec 24             	sub    $0x24,%esp
}

static inline uint32_t
rcr3(void) {
	uint32_t val;
	asm volatile ("movl %%cr3, %0" : "=r" (val));
c010549b:	0f 20 db             	mov    %cr3,%ebx
c010549e:	89 5d f0             	mov    %ebx,-0x10(%ebp)
	return val;
c01054a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
	if (rcr3() == PADDR(pgdir)) {
c01054a4:	89 c2                	mov    %eax,%edx
c01054a6:	8b 45 08             	mov    0x8(%ebp),%eax
c01054a9:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01054ac:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01054b3:	77 23                	ja     c01054d8 <tlb_invalidate+0x44>
c01054b5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01054b8:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01054bc:	c7 44 24 08 70 7e 10 	movl   $0xc0107e70,0x8(%esp)
c01054c3:	c0 
c01054c4:	c7 44 24 04 ba 01 00 	movl   $0x1ba,0x4(%esp)
c01054cb:	00 
c01054cc:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01054d3:	e8 2c c1 ff ff       	call   c0101604 <__panic>
c01054d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01054db:	05 00 00 00 40       	add    $0x40000000,%eax
c01054e0:	39 c2                	cmp    %eax,%edx
c01054e2:	75 0c                	jne    c01054f0 <tlb_invalidate+0x5c>
		invlpg((void *)la);
c01054e4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01054e7:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
	asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c01054ea:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01054ed:	0f 01 38             	invlpg (%eax)
	}
}
c01054f0:	83 c4 24             	add    $0x24,%esp
c01054f3:	5b                   	pop    %ebx
c01054f4:	5d                   	pop    %ebp
c01054f5:	c3                   	ret    

c01054f6 <check_alloc_page>:

static void
check_alloc_page(void) {
c01054f6:	55                   	push   %ebp
c01054f7:	89 e5                	mov    %esp,%ebp
c01054f9:	83 ec 18             	sub    $0x18,%esp
	pmm_manager->check();
c01054fc:	a1 90 ba 11 c0       	mov    0xc011ba90,%eax
c0105501:	8b 40 18             	mov    0x18(%eax),%eax
c0105504:	ff d0                	call   *%eax
	cprintf("check_alloc_page() succeeded!\n");
c0105506:	c7 04 24 f4 7e 10 c0 	movl   $0xc0107ef4,(%esp)
c010550d:	e8 9e ac ff ff       	call   c01001b0 <cprintf>
}
c0105512:	c9                   	leave  
c0105513:	c3                   	ret    

c0105514 <check_pgdir>:

static void
check_pgdir(void) {
c0105514:	55                   	push   %ebp
c0105515:	89 e5                	mov    %esp,%ebp
c0105517:	83 ec 38             	sub    $0x38,%esp
	assert(npage <= KMEMSIZE / PGSIZE);
c010551a:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c010551f:	3d 00 80 03 00       	cmp    $0x38000,%eax
c0105524:	76 24                	jbe    c010554a <check_pgdir+0x36>
c0105526:	c7 44 24 0c 13 7f 10 	movl   $0xc0107f13,0xc(%esp)
c010552d:	c0 
c010552e:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105535:	c0 
c0105536:	c7 44 24 04 c7 01 00 	movl   $0x1c7,0x4(%esp)
c010553d:	00 
c010553e:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105545:	e8 ba c0 ff ff       	call   c0101604 <__panic>
	assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c010554a:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c010554f:	85 c0                	test   %eax,%eax
c0105551:	74 0e                	je     c0105561 <check_pgdir+0x4d>
c0105553:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105558:	25 ff 0f 00 00       	and    $0xfff,%eax
c010555d:	85 c0                	test   %eax,%eax
c010555f:	74 24                	je     c0105585 <check_pgdir+0x71>
c0105561:	c7 44 24 0c 30 7f 10 	movl   $0xc0107f30,0xc(%esp)
c0105568:	c0 
c0105569:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105570:	c0 
c0105571:	c7 44 24 04 c8 01 00 	movl   $0x1c8,0x4(%esp)
c0105578:	00 
c0105579:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105580:	e8 7f c0 ff ff       	call   c0101604 <__panic>
	assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c0105585:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c010558a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0105591:	00 
c0105592:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0105599:	00 
c010559a:	89 04 24             	mov    %eax,(%esp)
c010559d:	e8 2c fd ff ff       	call   c01052ce <get_page>
c01055a2:	85 c0                	test   %eax,%eax
c01055a4:	74 24                	je     c01055ca <check_pgdir+0xb6>
c01055a6:	c7 44 24 0c 68 7f 10 	movl   $0xc0107f68,0xc(%esp)
c01055ad:	c0 
c01055ae:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01055b5:	c0 
c01055b6:	c7 44 24 04 c9 01 00 	movl   $0x1c9,0x4(%esp)
c01055bd:	00 
c01055be:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01055c5:	e8 3a c0 ff ff       	call   c0101604 <__panic>

	struct Page *p1, *p2;
	p1 = alloc_page();
c01055ca:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01055d1:	e8 1c f4 ff ff       	call   c01049f2 <alloc_pages>
c01055d6:	89 45 f4             	mov    %eax,-0xc(%ebp)
	assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c01055d9:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c01055de:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c01055e5:	00 
c01055e6:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01055ed:	00 
c01055ee:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01055f1:	89 54 24 04          	mov    %edx,0x4(%esp)
c01055f5:	89 04 24             	mov    %eax,(%esp)
c01055f8:	e8 de fd ff ff       	call   c01053db <page_insert>
c01055fd:	85 c0                	test   %eax,%eax
c01055ff:	74 24                	je     c0105625 <check_pgdir+0x111>
c0105601:	c7 44 24 0c 90 7f 10 	movl   $0xc0107f90,0xc(%esp)
c0105608:	c0 
c0105609:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105610:	c0 
c0105611:	c7 44 24 04 cd 01 00 	movl   $0x1cd,0x4(%esp)
c0105618:	00 
c0105619:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105620:	e8 df bf ff ff       	call   c0101604 <__panic>

	pte_t *ptep;
	assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c0105625:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c010562a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0105631:	00 
c0105632:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0105639:	00 
c010563a:	89 04 24             	mov    %eax,(%esp)
c010563d:	e8 f2 fa ff ff       	call   c0105134 <get_pte>
c0105642:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105645:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105649:	75 24                	jne    c010566f <check_pgdir+0x15b>
c010564b:	c7 44 24 0c bc 7f 10 	movl   $0xc0107fbc,0xc(%esp)
c0105652:	c0 
c0105653:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c010565a:	c0 
c010565b:	c7 44 24 04 d0 01 00 	movl   $0x1d0,0x4(%esp)
c0105662:	00 
c0105663:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c010566a:	e8 95 bf ff ff       	call   c0101604 <__panic>
	assert(pa2page(*ptep) == p1);
c010566f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105672:	8b 00                	mov    (%eax),%eax
c0105674:	89 04 24             	mov    %eax,(%esp)
c0105677:	e8 0e f0 ff ff       	call   c010468a <pa2page>
c010567c:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c010567f:	74 24                	je     c01056a5 <check_pgdir+0x191>
c0105681:	c7 44 24 0c e9 7f 10 	movl   $0xc0107fe9,0xc(%esp)
c0105688:	c0 
c0105689:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105690:	c0 
c0105691:	c7 44 24 04 d1 01 00 	movl   $0x1d1,0x4(%esp)
c0105698:	00 
c0105699:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01056a0:	e8 5f bf ff ff       	call   c0101604 <__panic>
	assert(page_ref(p1) == 1);
c01056a5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01056a8:	89 04 24             	mov    %eax,(%esp)
c01056ab:	e8 bb f0 ff ff       	call   c010476b <page_ref>
c01056b0:	83 f8 01             	cmp    $0x1,%eax
c01056b3:	74 24                	je     c01056d9 <check_pgdir+0x1c5>
c01056b5:	c7 44 24 0c fe 7f 10 	movl   $0xc0107ffe,0xc(%esp)
c01056bc:	c0 
c01056bd:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01056c4:	c0 
c01056c5:	c7 44 24 04 d2 01 00 	movl   $0x1d2,0x4(%esp)
c01056cc:	00 
c01056cd:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01056d4:	e8 2b bf ff ff       	call   c0101604 <__panic>

	ptep = &((pte_t *)KADDR(PTE_ADDR(boot_pgdir[0])))[1];
c01056d9:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c01056de:	8b 00                	mov    (%eax),%eax
c01056e0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01056e5:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01056e8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01056eb:	c1 e8 0c             	shr    $0xc,%eax
c01056ee:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01056f1:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c01056f6:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01056f9:	72 23                	jb     c010571e <check_pgdir+0x20a>
c01056fb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01056fe:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105702:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c0105709:	c0 
c010570a:	c7 44 24 04 d4 01 00 	movl   $0x1d4,0x4(%esp)
c0105711:	00 
c0105712:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105719:	e8 e6 be ff ff       	call   c0101604 <__panic>
c010571e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105721:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0105726:	83 c0 04             	add    $0x4,%eax
c0105729:	89 45 f0             	mov    %eax,-0x10(%ebp)
	assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c010572c:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105731:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0105738:	00 
c0105739:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0105740:	00 
c0105741:	89 04 24             	mov    %eax,(%esp)
c0105744:	e8 eb f9 ff ff       	call   c0105134 <get_pte>
c0105749:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c010574c:	74 24                	je     c0105772 <check_pgdir+0x25e>
c010574e:	c7 44 24 0c 10 80 10 	movl   $0xc0108010,0xc(%esp)
c0105755:	c0 
c0105756:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c010575d:	c0 
c010575e:	c7 44 24 04 d5 01 00 	movl   $0x1d5,0x4(%esp)
c0105765:	00 
c0105766:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c010576d:	e8 92 be ff ff       	call   c0101604 <__panic>

	p2 = alloc_page();
c0105772:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0105779:	e8 74 f2 ff ff       	call   c01049f2 <alloc_pages>
c010577e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0105781:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105786:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
c010578d:	00 
c010578e:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0105795:	00 
c0105796:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105799:	89 54 24 04          	mov    %edx,0x4(%esp)
c010579d:	89 04 24             	mov    %eax,(%esp)
c01057a0:	e8 36 fc ff ff       	call   c01053db <page_insert>
c01057a5:	85 c0                	test   %eax,%eax
c01057a7:	74 24                	je     c01057cd <check_pgdir+0x2b9>
c01057a9:	c7 44 24 0c 38 80 10 	movl   $0xc0108038,0xc(%esp)
c01057b0:	c0 
c01057b1:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01057b8:	c0 
c01057b9:	c7 44 24 04 d8 01 00 	movl   $0x1d8,0x4(%esp)
c01057c0:	00 
c01057c1:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01057c8:	e8 37 be ff ff       	call   c0101604 <__panic>
	assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c01057cd:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c01057d2:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01057d9:	00 
c01057da:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c01057e1:	00 
c01057e2:	89 04 24             	mov    %eax,(%esp)
c01057e5:	e8 4a f9 ff ff       	call   c0105134 <get_pte>
c01057ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01057ed:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01057f1:	75 24                	jne    c0105817 <check_pgdir+0x303>
c01057f3:	c7 44 24 0c 70 80 10 	movl   $0xc0108070,0xc(%esp)
c01057fa:	c0 
c01057fb:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105802:	c0 
c0105803:	c7 44 24 04 d9 01 00 	movl   $0x1d9,0x4(%esp)
c010580a:	00 
c010580b:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105812:	e8 ed bd ff ff       	call   c0101604 <__panic>
	assert(*ptep & PTE_U);
c0105817:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010581a:	8b 00                	mov    (%eax),%eax
c010581c:	83 e0 04             	and    $0x4,%eax
c010581f:	85 c0                	test   %eax,%eax
c0105821:	75 24                	jne    c0105847 <check_pgdir+0x333>
c0105823:	c7 44 24 0c a0 80 10 	movl   $0xc01080a0,0xc(%esp)
c010582a:	c0 
c010582b:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105832:	c0 
c0105833:	c7 44 24 04 da 01 00 	movl   $0x1da,0x4(%esp)
c010583a:	00 
c010583b:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105842:	e8 bd bd ff ff       	call   c0101604 <__panic>
	assert(*ptep & PTE_W);
c0105847:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010584a:	8b 00                	mov    (%eax),%eax
c010584c:	83 e0 02             	and    $0x2,%eax
c010584f:	85 c0                	test   %eax,%eax
c0105851:	75 24                	jne    c0105877 <check_pgdir+0x363>
c0105853:	c7 44 24 0c ae 80 10 	movl   $0xc01080ae,0xc(%esp)
c010585a:	c0 
c010585b:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105862:	c0 
c0105863:	c7 44 24 04 db 01 00 	movl   $0x1db,0x4(%esp)
c010586a:	00 
c010586b:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105872:	e8 8d bd ff ff       	call   c0101604 <__panic>
	assert(boot_pgdir[0] & PTE_U);
c0105877:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c010587c:	8b 00                	mov    (%eax),%eax
c010587e:	83 e0 04             	and    $0x4,%eax
c0105881:	85 c0                	test   %eax,%eax
c0105883:	75 24                	jne    c01058a9 <check_pgdir+0x395>
c0105885:	c7 44 24 0c bc 80 10 	movl   $0xc01080bc,0xc(%esp)
c010588c:	c0 
c010588d:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105894:	c0 
c0105895:	c7 44 24 04 dc 01 00 	movl   $0x1dc,0x4(%esp)
c010589c:	00 
c010589d:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01058a4:	e8 5b bd ff ff       	call   c0101604 <__panic>
	assert(page_ref(p2) == 1);
c01058a9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01058ac:	89 04 24             	mov    %eax,(%esp)
c01058af:	e8 b7 ee ff ff       	call   c010476b <page_ref>
c01058b4:	83 f8 01             	cmp    $0x1,%eax
c01058b7:	74 24                	je     c01058dd <check_pgdir+0x3c9>
c01058b9:	c7 44 24 0c d2 80 10 	movl   $0xc01080d2,0xc(%esp)
c01058c0:	c0 
c01058c1:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01058c8:	c0 
c01058c9:	c7 44 24 04 dd 01 00 	movl   $0x1dd,0x4(%esp)
c01058d0:	00 
c01058d1:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01058d8:	e8 27 bd ff ff       	call   c0101604 <__panic>

	assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c01058dd:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c01058e2:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c01058e9:	00 
c01058ea:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c01058f1:	00 
c01058f2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01058f5:	89 54 24 04          	mov    %edx,0x4(%esp)
c01058f9:	89 04 24             	mov    %eax,(%esp)
c01058fc:	e8 da fa ff ff       	call   c01053db <page_insert>
c0105901:	85 c0                	test   %eax,%eax
c0105903:	74 24                	je     c0105929 <check_pgdir+0x415>
c0105905:	c7 44 24 0c e4 80 10 	movl   $0xc01080e4,0xc(%esp)
c010590c:	c0 
c010590d:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105914:	c0 
c0105915:	c7 44 24 04 df 01 00 	movl   $0x1df,0x4(%esp)
c010591c:	00 
c010591d:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105924:	e8 db bc ff ff       	call   c0101604 <__panic>
	assert(page_ref(p1) == 2);
c0105929:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010592c:	89 04 24             	mov    %eax,(%esp)
c010592f:	e8 37 ee ff ff       	call   c010476b <page_ref>
c0105934:	83 f8 02             	cmp    $0x2,%eax
c0105937:	74 24                	je     c010595d <check_pgdir+0x449>
c0105939:	c7 44 24 0c 10 81 10 	movl   $0xc0108110,0xc(%esp)
c0105940:	c0 
c0105941:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105948:	c0 
c0105949:	c7 44 24 04 e0 01 00 	movl   $0x1e0,0x4(%esp)
c0105950:	00 
c0105951:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105958:	e8 a7 bc ff ff       	call   c0101604 <__panic>
	assert(page_ref(p2) == 0);
c010595d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105960:	89 04 24             	mov    %eax,(%esp)
c0105963:	e8 03 ee ff ff       	call   c010476b <page_ref>
c0105968:	85 c0                	test   %eax,%eax
c010596a:	74 24                	je     c0105990 <check_pgdir+0x47c>
c010596c:	c7 44 24 0c 22 81 10 	movl   $0xc0108122,0xc(%esp)
c0105973:	c0 
c0105974:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c010597b:	c0 
c010597c:	c7 44 24 04 e1 01 00 	movl   $0x1e1,0x4(%esp)
c0105983:	00 
c0105984:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c010598b:	e8 74 bc ff ff       	call   c0101604 <__panic>
	assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0105990:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105995:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010599c:	00 
c010599d:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c01059a4:	00 
c01059a5:	89 04 24             	mov    %eax,(%esp)
c01059a8:	e8 87 f7 ff ff       	call   c0105134 <get_pte>
c01059ad:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01059b0:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01059b4:	75 24                	jne    c01059da <check_pgdir+0x4c6>
c01059b6:	c7 44 24 0c 70 80 10 	movl   $0xc0108070,0xc(%esp)
c01059bd:	c0 
c01059be:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01059c5:	c0 
c01059c6:	c7 44 24 04 e2 01 00 	movl   $0x1e2,0x4(%esp)
c01059cd:	00 
c01059ce:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c01059d5:	e8 2a bc ff ff       	call   c0101604 <__panic>
	assert(pa2page(*ptep) == p1);
c01059da:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01059dd:	8b 00                	mov    (%eax),%eax
c01059df:	89 04 24             	mov    %eax,(%esp)
c01059e2:	e8 a3 ec ff ff       	call   c010468a <pa2page>
c01059e7:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01059ea:	74 24                	je     c0105a10 <check_pgdir+0x4fc>
c01059ec:	c7 44 24 0c e9 7f 10 	movl   $0xc0107fe9,0xc(%esp)
c01059f3:	c0 
c01059f4:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c01059fb:	c0 
c01059fc:	c7 44 24 04 e3 01 00 	movl   $0x1e3,0x4(%esp)
c0105a03:	00 
c0105a04:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105a0b:	e8 f4 bb ff ff       	call   c0101604 <__panic>
	assert((*ptep & PTE_U) == 0);
c0105a10:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a13:	8b 00                	mov    (%eax),%eax
c0105a15:	83 e0 04             	and    $0x4,%eax
c0105a18:	85 c0                	test   %eax,%eax
c0105a1a:	74 24                	je     c0105a40 <check_pgdir+0x52c>
c0105a1c:	c7 44 24 0c 34 81 10 	movl   $0xc0108134,0xc(%esp)
c0105a23:	c0 
c0105a24:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105a2b:	c0 
c0105a2c:	c7 44 24 04 e4 01 00 	movl   $0x1e4,0x4(%esp)
c0105a33:	00 
c0105a34:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105a3b:	e8 c4 bb ff ff       	call   c0101604 <__panic>

	page_remove(boot_pgdir, 0x0);
c0105a40:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105a45:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0105a4c:	00 
c0105a4d:	89 04 24             	mov    %eax,(%esp)
c0105a50:	e8 42 f9 ff ff       	call   c0105397 <page_remove>
	assert(page_ref(p1) == 1);
c0105a55:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105a58:	89 04 24             	mov    %eax,(%esp)
c0105a5b:	e8 0b ed ff ff       	call   c010476b <page_ref>
c0105a60:	83 f8 01             	cmp    $0x1,%eax
c0105a63:	74 24                	je     c0105a89 <check_pgdir+0x575>
c0105a65:	c7 44 24 0c fe 7f 10 	movl   $0xc0107ffe,0xc(%esp)
c0105a6c:	c0 
c0105a6d:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105a74:	c0 
c0105a75:	c7 44 24 04 e7 01 00 	movl   $0x1e7,0x4(%esp)
c0105a7c:	00 
c0105a7d:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105a84:	e8 7b bb ff ff       	call   c0101604 <__panic>
	assert(page_ref(p2) == 0);
c0105a89:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105a8c:	89 04 24             	mov    %eax,(%esp)
c0105a8f:	e8 d7 ec ff ff       	call   c010476b <page_ref>
c0105a94:	85 c0                	test   %eax,%eax
c0105a96:	74 24                	je     c0105abc <check_pgdir+0x5a8>
c0105a98:	c7 44 24 0c 22 81 10 	movl   $0xc0108122,0xc(%esp)
c0105a9f:	c0 
c0105aa0:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105aa7:	c0 
c0105aa8:	c7 44 24 04 e8 01 00 	movl   $0x1e8,0x4(%esp)
c0105aaf:	00 
c0105ab0:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105ab7:	e8 48 bb ff ff       	call   c0101604 <__panic>

	page_remove(boot_pgdir, PGSIZE);
c0105abc:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105ac1:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0105ac8:	00 
c0105ac9:	89 04 24             	mov    %eax,(%esp)
c0105acc:	e8 c6 f8 ff ff       	call   c0105397 <page_remove>
	assert(page_ref(p1) == 0);
c0105ad1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105ad4:	89 04 24             	mov    %eax,(%esp)
c0105ad7:	e8 8f ec ff ff       	call   c010476b <page_ref>
c0105adc:	85 c0                	test   %eax,%eax
c0105ade:	74 24                	je     c0105b04 <check_pgdir+0x5f0>
c0105ae0:	c7 44 24 0c 49 81 10 	movl   $0xc0108149,0xc(%esp)
c0105ae7:	c0 
c0105ae8:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105aef:	c0 
c0105af0:	c7 44 24 04 eb 01 00 	movl   $0x1eb,0x4(%esp)
c0105af7:	00 
c0105af8:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105aff:	e8 00 bb ff ff       	call   c0101604 <__panic>
	assert(page_ref(p2) == 0);
c0105b04:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105b07:	89 04 24             	mov    %eax,(%esp)
c0105b0a:	e8 5c ec ff ff       	call   c010476b <page_ref>
c0105b0f:	85 c0                	test   %eax,%eax
c0105b11:	74 24                	je     c0105b37 <check_pgdir+0x623>
c0105b13:	c7 44 24 0c 22 81 10 	movl   $0xc0108122,0xc(%esp)
c0105b1a:	c0 
c0105b1b:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105b22:	c0 
c0105b23:	c7 44 24 04 ec 01 00 	movl   $0x1ec,0x4(%esp)
c0105b2a:	00 
c0105b2b:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105b32:	e8 cd ba ff ff       	call   c0101604 <__panic>

	assert(page_ref(pa2page(boot_pgdir[0])) == 1);
c0105b37:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105b3c:	8b 00                	mov    (%eax),%eax
c0105b3e:	89 04 24             	mov    %eax,(%esp)
c0105b41:	e8 44 eb ff ff       	call   c010468a <pa2page>
c0105b46:	89 04 24             	mov    %eax,(%esp)
c0105b49:	e8 1d ec ff ff       	call   c010476b <page_ref>
c0105b4e:	83 f8 01             	cmp    $0x1,%eax
c0105b51:	74 24                	je     c0105b77 <check_pgdir+0x663>
c0105b53:	c7 44 24 0c 5c 81 10 	movl   $0xc010815c,0xc(%esp)
c0105b5a:	c0 
c0105b5b:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105b62:	c0 
c0105b63:	c7 44 24 04 ee 01 00 	movl   $0x1ee,0x4(%esp)
c0105b6a:	00 
c0105b6b:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105b72:	e8 8d ba ff ff       	call   c0101604 <__panic>
	free_page(pa2page(boot_pgdir[0]));
c0105b77:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105b7c:	8b 00                	mov    (%eax),%eax
c0105b7e:	89 04 24             	mov    %eax,(%esp)
c0105b81:	e8 04 eb ff ff       	call   c010468a <pa2page>
c0105b86:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0105b8d:	00 
c0105b8e:	89 04 24             	mov    %eax,(%esp)
c0105b91:	e8 8d ee ff ff       	call   c0104a23 <free_pages>
	boot_pgdir[0] = 0;
c0105b96:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105b9b:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

	cprintf("check_pgdir() succeeded!\n");
c0105ba1:	c7 04 24 82 81 10 c0 	movl   $0xc0108182,(%esp)
c0105ba8:	e8 03 a6 ff ff       	call   c01001b0 <cprintf>
}
c0105bad:	c9                   	leave  
c0105bae:	c3                   	ret    

c0105baf <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
c0105baf:	55                   	push   %ebp
c0105bb0:	89 e5                	mov    %esp,%ebp
c0105bb2:	83 ec 38             	sub    $0x38,%esp
	pte_t *ptep;
	int i;
	for (i = 0; i < npage; i += PGSIZE) {
c0105bb5:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0105bbc:	e9 cb 00 00 00       	jmp    c0105c8c <check_boot_pgdir+0xdd>
		assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c0105bc1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105bc4:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105bc7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105bca:	c1 e8 0c             	shr    $0xc,%eax
c0105bcd:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105bd0:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0105bd5:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0105bd8:	72 23                	jb     c0105bfd <check_boot_pgdir+0x4e>
c0105bda:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105bdd:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105be1:	c7 44 24 08 d0 7d 10 	movl   $0xc0107dd0,0x8(%esp)
c0105be8:	c0 
c0105be9:	c7 44 24 04 fa 01 00 	movl   $0x1fa,0x4(%esp)
c0105bf0:	00 
c0105bf1:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105bf8:	e8 07 ba ff ff       	call   c0101604 <__panic>
c0105bfd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c00:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0105c05:	89 c2                	mov    %eax,%edx
c0105c07:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105c0c:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0105c13:	00 
c0105c14:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105c18:	89 04 24             	mov    %eax,(%esp)
c0105c1b:	e8 14 f5 ff ff       	call   c0105134 <get_pte>
c0105c20:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105c23:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105c27:	75 24                	jne    c0105c4d <check_boot_pgdir+0x9e>
c0105c29:	c7 44 24 0c 9c 81 10 	movl   $0xc010819c,0xc(%esp)
c0105c30:	c0 
c0105c31:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105c38:	c0 
c0105c39:	c7 44 24 04 fa 01 00 	movl   $0x1fa,0x4(%esp)
c0105c40:	00 
c0105c41:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105c48:	e8 b7 b9 ff ff       	call   c0101604 <__panic>
		assert(PTE_ADDR(*ptep) == i);
c0105c4d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105c50:	8b 00                	mov    (%eax),%eax
c0105c52:	89 c2                	mov    %eax,%edx
c0105c54:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
c0105c5a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105c5d:	39 c2                	cmp    %eax,%edx
c0105c5f:	74 24                	je     c0105c85 <check_boot_pgdir+0xd6>
c0105c61:	c7 44 24 0c d9 81 10 	movl   $0xc01081d9,0xc(%esp)
c0105c68:	c0 
c0105c69:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105c70:	c0 
c0105c71:	c7 44 24 04 fb 01 00 	movl   $0x1fb,0x4(%esp)
c0105c78:	00 
c0105c79:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105c80:	e8 7f b9 ff ff       	call   c0101604 <__panic>

static void
check_boot_pgdir(void) {
	pte_t *ptep;
	int i;
	for (i = 0; i < npage; i += PGSIZE) {
c0105c85:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
c0105c8c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105c8f:	a1 00 ba 11 c0       	mov    0xc011ba00,%eax
c0105c94:	39 c2                	cmp    %eax,%edx
c0105c96:	0f 82 25 ff ff ff    	jb     c0105bc1 <check_boot_pgdir+0x12>
		assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
		assert(PTE_ADDR(*ptep) == i);
	}

	assert(PTE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c0105c9c:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105ca1:	05 ac 0f 00 00       	add    $0xfac,%eax
c0105ca6:	8b 00                	mov    (%eax),%eax
c0105ca8:	89 c2                	mov    %eax,%edx
c0105caa:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
c0105cb0:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105cb5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105cb8:	81 7d e4 ff ff ff bf 	cmpl   $0xbfffffff,-0x1c(%ebp)
c0105cbf:	77 23                	ja     c0105ce4 <check_boot_pgdir+0x135>
c0105cc1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105cc4:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105cc8:	c7 44 24 08 70 7e 10 	movl   $0xc0107e70,0x8(%esp)
c0105ccf:	c0 
c0105cd0:	c7 44 24 04 fe 01 00 	movl   $0x1fe,0x4(%esp)
c0105cd7:	00 
c0105cd8:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105cdf:	e8 20 b9 ff ff       	call   c0101604 <__panic>
c0105ce4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105ce7:	05 00 00 00 40       	add    $0x40000000,%eax
c0105cec:	39 c2                	cmp    %eax,%edx
c0105cee:	74 24                	je     c0105d14 <check_boot_pgdir+0x165>
c0105cf0:	c7 44 24 0c f0 81 10 	movl   $0xc01081f0,0xc(%esp)
c0105cf7:	c0 
c0105cf8:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105cff:	c0 
c0105d00:	c7 44 24 04 fe 01 00 	movl   $0x1fe,0x4(%esp)
c0105d07:	00 
c0105d08:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105d0f:	e8 f0 b8 ff ff       	call   c0101604 <__panic>

	assert(boot_pgdir[0] == 0);
c0105d14:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105d19:	8b 00                	mov    (%eax),%eax
c0105d1b:	85 c0                	test   %eax,%eax
c0105d1d:	74 24                	je     c0105d43 <check_boot_pgdir+0x194>
c0105d1f:	c7 44 24 0c 24 82 10 	movl   $0xc0108224,0xc(%esp)
c0105d26:	c0 
c0105d27:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105d2e:	c0 
c0105d2f:	c7 44 24 04 00 02 00 	movl   $0x200,0x4(%esp)
c0105d36:	00 
c0105d37:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105d3e:	e8 c1 b8 ff ff       	call   c0101604 <__panic>

	struct Page *p;
	p = alloc_page();
c0105d43:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0105d4a:	e8 a3 ec ff ff       	call   c01049f2 <alloc_pages>
c0105d4f:	89 45 e0             	mov    %eax,-0x20(%ebp)
	assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c0105d52:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105d57:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105d5e:	00 
c0105d5f:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
c0105d66:	00 
c0105d67:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105d6a:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105d6e:	89 04 24             	mov    %eax,(%esp)
c0105d71:	e8 65 f6 ff ff       	call   c01053db <page_insert>
c0105d76:	85 c0                	test   %eax,%eax
c0105d78:	74 24                	je     c0105d9e <check_boot_pgdir+0x1ef>
c0105d7a:	c7 44 24 0c 38 82 10 	movl   $0xc0108238,0xc(%esp)
c0105d81:	c0 
c0105d82:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105d89:	c0 
c0105d8a:	c7 44 24 04 04 02 00 	movl   $0x204,0x4(%esp)
c0105d91:	00 
c0105d92:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105d99:	e8 66 b8 ff ff       	call   c0101604 <__panic>
	assert(page_ref(p) == 1);
c0105d9e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105da1:	89 04 24             	mov    %eax,(%esp)
c0105da4:	e8 c2 e9 ff ff       	call   c010476b <page_ref>
c0105da9:	83 f8 01             	cmp    $0x1,%eax
c0105dac:	74 24                	je     c0105dd2 <check_boot_pgdir+0x223>
c0105dae:	c7 44 24 0c 66 82 10 	movl   $0xc0108266,0xc(%esp)
c0105db5:	c0 
c0105db6:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105dbd:	c0 
c0105dbe:	c7 44 24 04 05 02 00 	movl   $0x205,0x4(%esp)
c0105dc5:	00 
c0105dc6:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105dcd:	e8 32 b8 ff ff       	call   c0101604 <__panic>
	assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c0105dd2:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105dd7:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105dde:	00 
c0105ddf:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
c0105de6:	00 
c0105de7:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105dea:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105dee:	89 04 24             	mov    %eax,(%esp)
c0105df1:	e8 e5 f5 ff ff       	call   c01053db <page_insert>
c0105df6:	85 c0                	test   %eax,%eax
c0105df8:	74 24                	je     c0105e1e <check_boot_pgdir+0x26f>
c0105dfa:	c7 44 24 0c 78 82 10 	movl   $0xc0108278,0xc(%esp)
c0105e01:	c0 
c0105e02:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105e09:	c0 
c0105e0a:	c7 44 24 04 06 02 00 	movl   $0x206,0x4(%esp)
c0105e11:	00 
c0105e12:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105e19:	e8 e6 b7 ff ff       	call   c0101604 <__panic>
	assert(page_ref(p) == 2);
c0105e1e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105e21:	89 04 24             	mov    %eax,(%esp)
c0105e24:	e8 42 e9 ff ff       	call   c010476b <page_ref>
c0105e29:	83 f8 02             	cmp    $0x2,%eax
c0105e2c:	74 24                	je     c0105e52 <check_boot_pgdir+0x2a3>
c0105e2e:	c7 44 24 0c af 82 10 	movl   $0xc01082af,0xc(%esp)
c0105e35:	c0 
c0105e36:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105e3d:	c0 
c0105e3e:	c7 44 24 04 07 02 00 	movl   $0x207,0x4(%esp)
c0105e45:	00 
c0105e46:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105e4d:	e8 b2 b7 ff ff       	call   c0101604 <__panic>

	const char *str = "ucore: Hello world!!";
c0105e52:	c7 45 dc c0 82 10 c0 	movl   $0xc01082c0,-0x24(%ebp)
	strcpy((void *)0x100, str);
c0105e59:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105e5c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105e60:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105e67:	e8 ba 0a 00 00       	call   c0106926 <strcpy>
	assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c0105e6c:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
c0105e73:	00 
c0105e74:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105e7b:	e8 23 0b 00 00       	call   c01069a3 <strcmp>
c0105e80:	85 c0                	test   %eax,%eax
c0105e82:	74 24                	je     c0105ea8 <check_boot_pgdir+0x2f9>
c0105e84:	c7 44 24 0c d8 82 10 	movl   $0xc01082d8,0xc(%esp)
c0105e8b:	c0 
c0105e8c:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105e93:	c0 
c0105e94:	c7 44 24 04 0b 02 00 	movl   $0x20b,0x4(%esp)
c0105e9b:	00 
c0105e9c:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105ea3:	e8 5c b7 ff ff       	call   c0101604 <__panic>

	*(char *)(page2kva(p) + 0x100) = '\0';
c0105ea8:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105eab:	89 04 24             	mov    %eax,(%esp)
c0105eae:	e8 26 e8 ff ff       	call   c01046d9 <page2kva>
c0105eb3:	05 00 01 00 00       	add    $0x100,%eax
c0105eb8:	c6 00 00             	movb   $0x0,(%eax)
	assert(strlen((const char *)0x100) == '\0');
c0105ebb:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105ec2:	e8 01 0a 00 00       	call   c01068c8 <strlen>
c0105ec7:	85 c0                	test   %eax,%eax
c0105ec9:	74 24                	je     c0105eef <check_boot_pgdir+0x340>
c0105ecb:	c7 44 24 0c 10 83 10 	movl   $0xc0108310,0xc(%esp)
c0105ed2:	c0 
c0105ed3:	c7 44 24 08 b9 7e 10 	movl   $0xc0107eb9,0x8(%esp)
c0105eda:	c0 
c0105edb:	c7 44 24 04 0e 02 00 	movl   $0x20e,0x4(%esp)
c0105ee2:	00 
c0105ee3:	c7 04 24 94 7e 10 c0 	movl   $0xc0107e94,(%esp)
c0105eea:	e8 15 b7 ff ff       	call   c0101604 <__panic>

	free_page(p);
c0105eef:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0105ef6:	00 
c0105ef7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105efa:	89 04 24             	mov    %eax,(%esp)
c0105efd:	e8 21 eb ff ff       	call   c0104a23 <free_pages>
	free_page(pa2page(PTE_ADDR(boot_pgdir[0])));
c0105f02:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105f07:	8b 00                	mov    (%eax),%eax
c0105f09:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0105f0e:	89 04 24             	mov    %eax,(%esp)
c0105f11:	e8 74 e7 ff ff       	call   c010468a <pa2page>
c0105f16:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0105f1d:	00 
c0105f1e:	89 04 24             	mov    %eax,(%esp)
c0105f21:	e8 fd ea ff ff       	call   c0104a23 <free_pages>
	boot_pgdir[0] = 0;
c0105f26:	a1 04 ba 11 c0       	mov    0xc011ba04,%eax
c0105f2b:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

	cprintf("check_boot_pgdir() succeeded!\n");
c0105f31:	c7 04 24 34 83 10 c0 	movl   $0xc0108334,(%esp)
c0105f38:	e8 73 a2 ff ff       	call   c01001b0 <cprintf>
}
c0105f3d:	c9                   	leave  
c0105f3e:	c3                   	ret    

c0105f3f <perm2str>:

static const char *
perm2str(int perm) {
c0105f3f:	55                   	push   %ebp
c0105f40:	89 e5                	mov    %esp,%ebp
	static char str[4];
	str[0] = (perm & PTE_U) ? 'u' : '-';
c0105f42:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f45:	83 e0 04             	and    $0x4,%eax
c0105f48:	85 c0                	test   %eax,%eax
c0105f4a:	74 07                	je     c0105f53 <perm2str+0x14>
c0105f4c:	b8 75 00 00 00       	mov    $0x75,%eax
c0105f51:	eb 05                	jmp    c0105f58 <perm2str+0x19>
c0105f53:	b8 2d 00 00 00       	mov    $0x2d,%eax
c0105f58:	a2 88 ba 11 c0       	mov    %al,0xc011ba88
	str[1] = 'r';
c0105f5d:	c6 05 89 ba 11 c0 72 	movb   $0x72,0xc011ba89
	str[2] = (perm & PTE_W) ? 'w' : '-';
c0105f64:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f67:	83 e0 02             	and    $0x2,%eax
c0105f6a:	85 c0                	test   %eax,%eax
c0105f6c:	74 07                	je     c0105f75 <perm2str+0x36>
c0105f6e:	b8 77 00 00 00       	mov    $0x77,%eax
c0105f73:	eb 05                	jmp    c0105f7a <perm2str+0x3b>
c0105f75:	b8 2d 00 00 00       	mov    $0x2d,%eax
c0105f7a:	a2 8a ba 11 c0       	mov    %al,0xc011ba8a
	str[3] = '\0';
c0105f7f:	c6 05 8b ba 11 c0 00 	movb   $0x0,0xc011ba8b
	return str;
c0105f86:	b8 88 ba 11 c0       	mov    $0xc011ba88,%eax
}
c0105f8b:	5d                   	pop    %ebp
c0105f8c:	c3                   	ret    

c0105f8d <get_pgtable_items>:

static int
get_pgtable_items(int left, int right, int start, uint32_t *table, int *left_store, int *right_store) {
c0105f8d:	55                   	push   %ebp
c0105f8e:	89 e5                	mov    %esp,%ebp
c0105f90:	83 ec 10             	sub    $0x10,%esp
	 * good luck...
	 *
	 * Task3
	 */
	 //Important!! The permission
	while ((start < right) && !(table[start] & PTE_P))
c0105f93:	eb 04                	jmp    c0105f99 <get_pgtable_items+0xc>
		start ++;
c0105f95:	83 45 10 01          	addl   $0x1,0x10(%ebp)
	 * good luck...
	 *
	 * Task3
	 */
	 //Important!! The permission
	while ((start < right) && !(table[start] & PTE_P))
c0105f99:	8b 45 10             	mov    0x10(%ebp),%eax
c0105f9c:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105f9f:	7d 12                	jge    c0105fb3 <get_pgtable_items+0x26>
c0105fa1:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fa4:	c1 e0 02             	shl    $0x2,%eax
c0105fa7:	03 45 14             	add    0x14(%ebp),%eax
c0105faa:	8b 00                	mov    (%eax),%eax
c0105fac:	83 e0 01             	and    $0x1,%eax
c0105faf:	85 c0                	test   %eax,%eax
c0105fb1:	74 e2                	je     c0105f95 <get_pgtable_items+0x8>
		start ++;

	//Important!! The start must < right
	if (start < right) {
c0105fb3:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fb6:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105fb9:	7d 61                	jge    c010601c <get_pgtable_items+0x8f>
		//Important!! The left_store must exist
		if(left_store != NULL)
c0105fbb:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c0105fbf:	74 08                	je     c0105fc9 <get_pgtable_items+0x3c>
			*left_store = start;
c0105fc1:	8b 45 18             	mov    0x18(%ebp),%eax
c0105fc4:	8b 55 10             	mov    0x10(%ebp),%edx
c0105fc7:	89 10                	mov    %edx,(%eax)
		int perm = table[start] & PTE_USER;
c0105fc9:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fcc:	c1 e0 02             	shl    $0x2,%eax
c0105fcf:	03 45 14             	add    0x14(%ebp),%eax
c0105fd2:	8b 00                	mov    (%eax),%eax
c0105fd4:	83 e0 07             	and    $0x7,%eax
c0105fd7:	89 45 f8             	mov    %eax,-0x8(%ebp)
		int i;
		for(i = start + 1;i < right;i++) {
c0105fda:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fdd:	83 c0 01             	add    $0x1,%eax
c0105fe0:	89 45 fc             	mov    %eax,-0x4(%ebp)
c0105fe3:	eb 19                	jmp    c0105ffe <get_pgtable_items+0x71>
			//Permission
			if(perm != (table[i] & PTE_USER))
c0105fe5:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0105fe8:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105feb:	c1 e0 02             	shl    $0x2,%eax
c0105fee:	03 45 14             	add    0x14(%ebp),%eax
c0105ff1:	8b 00                	mov    (%eax),%eax
c0105ff3:	83 e0 07             	and    $0x7,%eax
c0105ff6:	39 c2                	cmp    %eax,%edx
c0105ff8:	75 0e                	jne    c0106008 <get_pgtable_items+0x7b>
		//Important!! The left_store must exist
		if(left_store != NULL)
			*left_store = start;
		int perm = table[start] & PTE_USER;
		int i;
		for(i = start + 1;i < right;i++) {
c0105ffa:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0105ffe:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106001:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0106004:	7c df                	jl     c0105fe5 <get_pgtable_items+0x58>
c0106006:	eb 01                	jmp    c0106009 <get_pgtable_items+0x7c>
			//Permission
			if(perm != (table[i] & PTE_USER))
				break;
c0106008:	90                   	nop
		}
		//Important!! The right_store must exist
		if (right_store != NULL)
c0106009:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c010600d:	74 08                	je     c0106017 <get_pgtable_items+0x8a>
			*right_store = i;
c010600f:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0106012:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0106015:	89 10                	mov    %edx,(%eax)
		return perm;
c0106017:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010601a:	eb 05                	jmp    c0106021 <get_pgtable_items+0x94>
	}
    else {	
        return 0;
c010601c:	b8 00 00 00 00       	mov    $0x0,%eax
    }
}
c0106021:	c9                   	leave  
c0106022:	c3                   	ret    

c0106023 <print_pgdir>:

void
print_pgdir(void) {
c0106023:	55                   	push   %ebp
c0106024:	89 e5                	mov    %esp,%ebp
c0106026:	57                   	push   %edi
c0106027:	56                   	push   %esi
c0106028:	53                   	push   %ebx
c0106029:	83 ec 5c             	sub    $0x5c,%esp
	cprintf("-------------------- BEGIN --------------------\n");
c010602c:	c7 04 24 54 83 10 c0 	movl   $0xc0108354,(%esp)
c0106033:	e8 78 a1 ff ff       	call   c01001b0 <cprintf>
	int left, right = 0, perm;
c0106038:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
	while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c010603f:	e9 0b 01 00 00       	jmp    c010614f <print_pgdir+0x12c>
		cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c0106044:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106047:	89 04 24             	mov    %eax,(%esp)
c010604a:	e8 f0 fe ff ff       	call   c0105f3f <perm2str>
				left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c010604f:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0106052:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0106055:	89 cb                	mov    %ecx,%ebx
c0106057:	29 d3                	sub    %edx,%ebx
c0106059:	89 da                	mov    %ebx,%edx
void
print_pgdir(void) {
	cprintf("-------------------- BEGIN --------------------\n");
	int left, right = 0, perm;
	while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
		cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c010605b:	89 d6                	mov    %edx,%esi
c010605d:	c1 e6 16             	shl    $0x16,%esi
c0106060:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106063:	89 d3                	mov    %edx,%ebx
c0106065:	c1 e3 16             	shl    $0x16,%ebx
c0106068:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010606b:	89 d1                	mov    %edx,%ecx
c010606d:	c1 e1 16             	shl    $0x16,%ecx
c0106070:	8b 7d dc             	mov    -0x24(%ebp),%edi
c0106073:	89 7d c4             	mov    %edi,-0x3c(%ebp)
c0106076:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0106079:	8b 7d c4             	mov    -0x3c(%ebp),%edi
c010607c:	29 d7                	sub    %edx,%edi
c010607e:	89 fa                	mov    %edi,%edx
c0106080:	89 44 24 14          	mov    %eax,0x14(%esp)
c0106084:	89 74 24 10          	mov    %esi,0x10(%esp)
c0106088:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c010608c:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0106090:	89 54 24 04          	mov    %edx,0x4(%esp)
c0106094:	c7 04 24 85 83 10 c0 	movl   $0xc0108385,(%esp)
c010609b:	e8 10 a1 ff ff       	call   c01001b0 <cprintf>
				left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
		int l, r = left * NPTEENTRY;
c01060a0:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01060a3:	c1 e0 0a             	shl    $0xa,%eax
c01060a6:	89 45 d4             	mov    %eax,-0x2c(%ebp)
		while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c01060a9:	eb 5c                	jmp    c0106107 <print_pgdir+0xe4>
			cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c01060ab:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01060ae:	89 04 24             	mov    %eax,(%esp)
c01060b1:	e8 89 fe ff ff       	call   c0105f3f <perm2str>
					l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c01060b6:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c01060b9:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01060bc:	89 cb                	mov    %ecx,%ebx
c01060be:	29 d3                	sub    %edx,%ebx
c01060c0:	89 da                	mov    %ebx,%edx
	while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
		cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
				left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
		int l, r = left * NPTEENTRY;
		while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
			cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c01060c2:	89 d6                	mov    %edx,%esi
c01060c4:	c1 e6 0c             	shl    $0xc,%esi
c01060c7:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01060ca:	89 d3                	mov    %edx,%ebx
c01060cc:	c1 e3 0c             	shl    $0xc,%ebx
c01060cf:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01060d2:	89 d1                	mov    %edx,%ecx
c01060d4:	c1 e1 0c             	shl    $0xc,%ecx
c01060d7:	8b 7d d4             	mov    -0x2c(%ebp),%edi
c01060da:	89 7d c4             	mov    %edi,-0x3c(%ebp)
c01060dd:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01060e0:	8b 7d c4             	mov    -0x3c(%ebp),%edi
c01060e3:	29 d7                	sub    %edx,%edi
c01060e5:	89 fa                	mov    %edi,%edx
c01060e7:	89 44 24 14          	mov    %eax,0x14(%esp)
c01060eb:	89 74 24 10          	mov    %esi,0x10(%esp)
c01060ef:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c01060f3:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c01060f7:	89 54 24 04          	mov    %edx,0x4(%esp)
c01060fb:	c7 04 24 a4 83 10 c0 	movl   $0xc01083a4,(%esp)
c0106102:	e8 a9 a0 ff ff       	call   c01001b0 <cprintf>
	int left, right = 0, perm;
	while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
		cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
				left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
		int l, r = left * NPTEENTRY;
		while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c0106107:	8b 15 18 7e 10 c0    	mov    0xc0107e18,%edx
c010610d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0106110:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0106113:	89 ce                	mov    %ecx,%esi
c0106115:	c1 e6 0a             	shl    $0xa,%esi
c0106118:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c010611b:	89 cb                	mov    %ecx,%ebx
c010611d:	c1 e3 0a             	shl    $0xa,%ebx
c0106120:	8d 4d d4             	lea    -0x2c(%ebp),%ecx
c0106123:	89 4c 24 14          	mov    %ecx,0x14(%esp)
c0106127:	8d 4d d8             	lea    -0x28(%ebp),%ecx
c010612a:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010612e:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0106132:	89 44 24 08          	mov    %eax,0x8(%esp)
c0106136:	89 74 24 04          	mov    %esi,0x4(%esp)
c010613a:	89 1c 24             	mov    %ebx,(%esp)
c010613d:	e8 4b fe ff ff       	call   c0105f8d <get_pgtable_items>
c0106142:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0106145:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0106149:	0f 85 5c ff ff ff    	jne    c01060ab <print_pgdir+0x88>

void
print_pgdir(void) {
	cprintf("-------------------- BEGIN --------------------\n");
	int left, right = 0, perm;
	while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c010614f:	8b 15 1c 7e 10 c0    	mov    0xc0107e1c,%edx
c0106155:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0106158:	8d 4d dc             	lea    -0x24(%ebp),%ecx
c010615b:	89 4c 24 14          	mov    %ecx,0x14(%esp)
c010615f:	8d 4d e0             	lea    -0x20(%ebp),%ecx
c0106162:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c0106166:	89 54 24 0c          	mov    %edx,0xc(%esp)
c010616a:	89 44 24 08          	mov    %eax,0x8(%esp)
c010616e:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
c0106175:	00 
c0106176:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010617d:	e8 0b fe ff ff       	call   c0105f8d <get_pgtable_items>
c0106182:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0106185:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0106189:	0f 85 b5 fe ff ff    	jne    c0106044 <print_pgdir+0x21>
		while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
			cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
					l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
		}
	}
	cprintf("--------------------- END ---------------------\n");
c010618f:	c7 04 24 c8 83 10 c0 	movl   $0xc01083c8,(%esp)
c0106196:	e8 15 a0 ff ff       	call   c01001b0 <cprintf>
}
c010619b:	83 c4 5c             	add    $0x5c,%esp
c010619e:	5b                   	pop    %ebx
c010619f:	5e                   	pop    %esi
c01061a0:	5f                   	pop    %edi
c01061a1:	5d                   	pop    %ebp
c01061a2:	c3                   	ret    
	...

c01061a4 <printnum>:
 * @width: 		maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:		character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
		unsigned long long num, unsigned base, int width, int padc) {
c01061a4:	55                   	push   %ebp
c01061a5:	89 e5                	mov    %esp,%ebp
c01061a7:	56                   	push   %esi
c01061a8:	53                   	push   %ebx
c01061a9:	83 ec 60             	sub    $0x60,%esp
c01061ac:	8b 45 10             	mov    0x10(%ebp),%eax
c01061af:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01061b2:	8b 45 14             	mov    0x14(%ebp),%eax
c01061b5:	89 45 d4             	mov    %eax,-0x2c(%ebp)
	unsigned long long result = num;
c01061b8:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01061bb:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01061be:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01061c1:	89 55 ec             	mov    %edx,-0x14(%ebp)
	unsigned mod = do_div(result, base);
c01061c4:	8b 45 18             	mov    0x18(%ebp),%eax
c01061c7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01061ca:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01061cd:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01061d0:	89 45 c0             	mov    %eax,-0x40(%ebp)
c01061d3:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c01061d6:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01061d9:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01061dc:	89 d3                	mov    %edx,%ebx
c01061de:	89 c6                	mov    %eax,%esi
c01061e0:	89 75 e0             	mov    %esi,-0x20(%ebp)
c01061e3:	89 5d f0             	mov    %ebx,-0x10(%ebp)
c01061e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01061e9:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01061ec:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01061f0:	74 1c                	je     c010620e <printnum+0x6a>
c01061f2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01061f5:	ba 00 00 00 00       	mov    $0x0,%edx
c01061fa:	f7 75 e4             	divl   -0x1c(%ebp)
c01061fd:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0106200:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106203:	ba 00 00 00 00       	mov    $0x0,%edx
c0106208:	f7 75 e4             	divl   -0x1c(%ebp)
c010620b:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010620e:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0106211:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106214:	89 d6                	mov    %edx,%esi
c0106216:	89 c3                	mov    %eax,%ebx
c0106218:	89 f0                	mov    %esi,%eax
c010621a:	89 da                	mov    %ebx,%edx
c010621c:	f7 75 e4             	divl   -0x1c(%ebp)
c010621f:	89 d3                	mov    %edx,%ebx
c0106221:	89 c6                	mov    %eax,%esi
c0106223:	89 75 e0             	mov    %esi,-0x20(%ebp)
c0106226:	89 5d dc             	mov    %ebx,-0x24(%ebp)
c0106229:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010622c:	89 45 c0             	mov    %eax,-0x40(%ebp)
c010622f:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0106232:	89 55 bc             	mov    %edx,-0x44(%ebp)
c0106235:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0106238:	8b 55 bc             	mov    -0x44(%ebp),%edx
c010623b:	89 c3                	mov    %eax,%ebx
c010623d:	89 d6                	mov    %edx,%esi
c010623f:	89 5d e8             	mov    %ebx,-0x18(%ebp)
c0106242:	89 75 ec             	mov    %esi,-0x14(%ebp)
c0106245:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0106248:	89 45 d8             	mov    %eax,-0x28(%ebp)

	// first recursively print all preceding (more significant) digits
	if (num >= base) {
c010624b:	8b 45 18             	mov    0x18(%ebp),%eax
c010624e:	ba 00 00 00 00       	mov    $0x0,%edx
c0106253:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c0106256:	77 56                	ja     c01062ae <printnum+0x10a>
c0106258:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c010625b:	72 05                	jb     c0106262 <printnum+0xbe>
c010625d:	3b 45 d0             	cmp    -0x30(%ebp),%eax
c0106260:	77 4c                	ja     c01062ae <printnum+0x10a>
		printnum(putch, putdat, result, base, width - 1, padc);
c0106262:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0106265:	8d 50 ff             	lea    -0x1(%eax),%edx
c0106268:	8b 45 20             	mov    0x20(%ebp),%eax
c010626b:	89 44 24 18          	mov    %eax,0x18(%esp)
c010626f:	89 54 24 14          	mov    %edx,0x14(%esp)
c0106273:	8b 45 18             	mov    0x18(%ebp),%eax
c0106276:	89 44 24 10          	mov    %eax,0x10(%esp)
c010627a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010627d:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0106280:	89 44 24 08          	mov    %eax,0x8(%esp)
c0106284:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0106288:	8b 45 0c             	mov    0xc(%ebp),%eax
c010628b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010628f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106292:	89 04 24             	mov    %eax,(%esp)
c0106295:	e8 0a ff ff ff       	call   c01061a4 <printnum>
c010629a:	eb 1c                	jmp    c01062b8 <printnum+0x114>
	} else {
		// print any needed pad characters before first digit
		while (-- width > 0)
			putch(padc, putdat);
c010629c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010629f:	89 44 24 04          	mov    %eax,0x4(%esp)
c01062a3:	8b 45 20             	mov    0x20(%ebp),%eax
c01062a6:	89 04 24             	mov    %eax,(%esp)
c01062a9:	8b 45 08             	mov    0x8(%ebp),%eax
c01062ac:	ff d0                	call   *%eax
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
		printnum(putch, putdat, result, base, width - 1, padc);
	} else {
		// print any needed pad characters before first digit
		while (-- width > 0)
c01062ae:	83 6d 1c 01          	subl   $0x1,0x1c(%ebp)
c01062b2:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c01062b6:	7f e4                	jg     c010629c <printnum+0xf8>
			putch(padc, putdat);
	}
	// then print this (the least significant) digit
	putch("0123456789abcdef"[mod], putdat);
c01062b8:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01062bb:	05 7c 84 10 c0       	add    $0xc010847c,%eax
c01062c0:	0f b6 00             	movzbl (%eax),%eax
c01062c3:	0f be c0             	movsbl %al,%eax
c01062c6:	8b 55 0c             	mov    0xc(%ebp),%edx
c01062c9:	89 54 24 04          	mov    %edx,0x4(%esp)
c01062cd:	89 04 24             	mov    %eax,(%esp)
c01062d0:	8b 45 08             	mov    0x8(%ebp),%eax
c01062d3:	ff d0                	call   *%eax
}
c01062d5:	83 c4 60             	add    $0x60,%esp
c01062d8:	5b                   	pop    %ebx
c01062d9:	5e                   	pop    %esi
c01062da:	5d                   	pop    %ebp
c01062db:	c3                   	ret    

c01062dc <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:			a varargs list pointer
 * @lflag:		determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c01062dc:	55                   	push   %ebp
c01062dd:	89 e5                	mov    %esp,%ebp
	if (lflag >= 2) {
c01062df:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c01062e3:	7e 1c                	jle    c0106301 <getuint+0x25>
		return va_arg(*ap, unsigned long long);
c01062e5:	8b 45 08             	mov    0x8(%ebp),%eax
c01062e8:	8b 00                	mov    (%eax),%eax
c01062ea:	8d 50 08             	lea    0x8(%eax),%edx
c01062ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01062f0:	89 10                	mov    %edx,(%eax)
c01062f2:	8b 45 08             	mov    0x8(%ebp),%eax
c01062f5:	8b 00                	mov    (%eax),%eax
c01062f7:	83 e8 08             	sub    $0x8,%eax
c01062fa:	8b 50 04             	mov    0x4(%eax),%edx
c01062fd:	8b 00                	mov    (%eax),%eax
c01062ff:	eb 40                	jmp    c0106341 <getuint+0x65>
	}
	else if (lflag) {
c0106301:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0106305:	74 1e                	je     c0106325 <getuint+0x49>
		return va_arg(*ap, unsigned long);
c0106307:	8b 45 08             	mov    0x8(%ebp),%eax
c010630a:	8b 00                	mov    (%eax),%eax
c010630c:	8d 50 04             	lea    0x4(%eax),%edx
c010630f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106312:	89 10                	mov    %edx,(%eax)
c0106314:	8b 45 08             	mov    0x8(%ebp),%eax
c0106317:	8b 00                	mov    (%eax),%eax
c0106319:	83 e8 04             	sub    $0x4,%eax
c010631c:	8b 00                	mov    (%eax),%eax
c010631e:	ba 00 00 00 00       	mov    $0x0,%edx
c0106323:	eb 1c                	jmp    c0106341 <getuint+0x65>
	}
	else {
		return va_arg(*ap, unsigned int);
c0106325:	8b 45 08             	mov    0x8(%ebp),%eax
c0106328:	8b 00                	mov    (%eax),%eax
c010632a:	8d 50 04             	lea    0x4(%eax),%edx
c010632d:	8b 45 08             	mov    0x8(%ebp),%eax
c0106330:	89 10                	mov    %edx,(%eax)
c0106332:	8b 45 08             	mov    0x8(%ebp),%eax
c0106335:	8b 00                	mov    (%eax),%eax
c0106337:	83 e8 04             	sub    $0x4,%eax
c010633a:	8b 00                	mov    (%eax),%eax
c010633c:	ba 00 00 00 00       	mov    $0x0,%edx
	}
}
c0106341:	5d                   	pop    %ebp
c0106342:	c3                   	ret    

c0106343 <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:			a varargs list pointer
 * @lflag:		determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c0106343:	55                   	push   %ebp
c0106344:	89 e5                	mov    %esp,%ebp
	if (lflag >= 2) {
c0106346:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c010634a:	7e 1c                	jle    c0106368 <getint+0x25>
		return va_arg(*ap, long long);
c010634c:	8b 45 08             	mov    0x8(%ebp),%eax
c010634f:	8b 00                	mov    (%eax),%eax
c0106351:	8d 50 08             	lea    0x8(%eax),%edx
c0106354:	8b 45 08             	mov    0x8(%ebp),%eax
c0106357:	89 10                	mov    %edx,(%eax)
c0106359:	8b 45 08             	mov    0x8(%ebp),%eax
c010635c:	8b 00                	mov    (%eax),%eax
c010635e:	83 e8 08             	sub    $0x8,%eax
c0106361:	8b 50 04             	mov    0x4(%eax),%edx
c0106364:	8b 00                	mov    (%eax),%eax
c0106366:	eb 40                	jmp    c01063a8 <getint+0x65>
	}
	else if (lflag) {
c0106368:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010636c:	74 1e                	je     c010638c <getint+0x49>
		return va_arg(*ap, long);
c010636e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106371:	8b 00                	mov    (%eax),%eax
c0106373:	8d 50 04             	lea    0x4(%eax),%edx
c0106376:	8b 45 08             	mov    0x8(%ebp),%eax
c0106379:	89 10                	mov    %edx,(%eax)
c010637b:	8b 45 08             	mov    0x8(%ebp),%eax
c010637e:	8b 00                	mov    (%eax),%eax
c0106380:	83 e8 04             	sub    $0x4,%eax
c0106383:	8b 00                	mov    (%eax),%eax
c0106385:	89 c2                	mov    %eax,%edx
c0106387:	c1 fa 1f             	sar    $0x1f,%edx
c010638a:	eb 1c                	jmp    c01063a8 <getint+0x65>
	}
	else {
		return va_arg(*ap, int);
c010638c:	8b 45 08             	mov    0x8(%ebp),%eax
c010638f:	8b 00                	mov    (%eax),%eax
c0106391:	8d 50 04             	lea    0x4(%eax),%edx
c0106394:	8b 45 08             	mov    0x8(%ebp),%eax
c0106397:	89 10                	mov    %edx,(%eax)
c0106399:	8b 45 08             	mov    0x8(%ebp),%eax
c010639c:	8b 00                	mov    (%eax),%eax
c010639e:	83 e8 04             	sub    $0x4,%eax
c01063a1:	8b 00                	mov    (%eax),%eax
c01063a3:	89 c2                	mov    %eax,%edx
c01063a5:	c1 fa 1f             	sar    $0x1f,%edx
	}
}
c01063a8:	5d                   	pop    %ebp
c01063a9:	c3                   	ret    

c01063aa <printfmt>:
 * @putch:		specified putch function, print a single character
 * @putdat:		used by @putch function
 * @fmt:		the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c01063aa:	55                   	push   %ebp
c01063ab:	89 e5                	mov    %esp,%ebp
c01063ad:	83 ec 28             	sub    $0x28,%esp
	va_list ap;

	va_start(ap, fmt);
c01063b0:	8d 45 10             	lea    0x10(%ebp),%eax
c01063b3:	83 c0 04             	add    $0x4,%eax
c01063b6:	89 45 f4             	mov    %eax,-0xc(%ebp)
	vprintfmt(putch, putdat, fmt, ap);
c01063b9:	8b 45 10             	mov    0x10(%ebp),%eax
c01063bc:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01063bf:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01063c3:	89 44 24 08          	mov    %eax,0x8(%esp)
c01063c7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01063ca:	89 44 24 04          	mov    %eax,0x4(%esp)
c01063ce:	8b 45 08             	mov    0x8(%ebp),%eax
c01063d1:	89 04 24             	mov    %eax,(%esp)
c01063d4:	e8 02 00 00 00       	call   c01063db <vprintfmt>
	va_end(ap);
}
c01063d9:	c9                   	leave  
c01063da:	c3                   	ret    

c01063db <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c01063db:	55                   	push   %ebp
c01063dc:	89 e5                	mov    %esp,%ebp
c01063de:	56                   	push   %esi
c01063df:	53                   	push   %ebx
c01063e0:	83 ec 40             	sub    $0x40,%esp
	register int ch, err;
	unsigned long long num;
	int base, width, precision, lflag, altflag;

	while (1) {
		while ((ch = *(unsigned char *)fmt ++) != '%') {
c01063e3:	eb 17                	jmp    c01063fc <vprintfmt+0x21>
			if (ch == '\0') {
c01063e5:	85 db                	test   %ebx,%ebx
c01063e7:	0f 84 04 04 00 00    	je     c01067f1 <vprintfmt+0x416>
				return;
			}
			putch(ch, putdat);
c01063ed:	8b 45 0c             	mov    0xc(%ebp),%eax
c01063f0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01063f4:	89 1c 24             	mov    %ebx,(%esp)
c01063f7:	8b 45 08             	mov    0x8(%ebp),%eax
c01063fa:	ff d0                	call   *%eax
	register int ch, err;
	unsigned long long num;
	int base, width, precision, lflag, altflag;

	while (1) {
		while ((ch = *(unsigned char *)fmt ++) != '%') {
c01063fc:	8b 45 10             	mov    0x10(%ebp),%eax
c01063ff:	0f b6 00             	movzbl (%eax),%eax
c0106402:	0f b6 d8             	movzbl %al,%ebx
c0106405:	83 fb 25             	cmp    $0x25,%ebx
c0106408:	0f 95 c0             	setne  %al
c010640b:	83 45 10 01          	addl   $0x1,0x10(%ebp)
c010640f:	84 c0                	test   %al,%al
c0106411:	75 d2                	jne    c01063e5 <vprintfmt+0xa>
			}
			putch(ch, putdat);
		}

		// Process a %-escape sequence
		char padc = ' ';
c0106413:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
		width = precision = -1;
c0106417:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
c010641e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106421:	89 45 e8             	mov    %eax,-0x18(%ebp)
		lflag = altflag = 0;
c0106424:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c010642b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010642e:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0106431:	eb 04                	jmp    c0106437 <vprintfmt+0x5c>
			goto process_precision;

		case '.':
			if (width < 0)
				width = 0;
			goto reswitch;
c0106433:	90                   	nop
c0106434:	eb 01                	jmp    c0106437 <vprintfmt+0x5c>
			goto reswitch;

		process_precision:
			if (width < 0)
				width = precision, precision = -1;
			goto reswitch;
c0106436:	90                   	nop
		char padc = ' ';
		width = precision = -1;
		lflag = altflag = 0;

	reswitch:
		switch (ch = *(unsigned char *)fmt ++) {
c0106437:	8b 45 10             	mov    0x10(%ebp),%eax
c010643a:	0f b6 00             	movzbl (%eax),%eax
c010643d:	0f b6 d8             	movzbl %al,%ebx
c0106440:	89 d8                	mov    %ebx,%eax
c0106442:	83 45 10 01          	addl   $0x1,0x10(%ebp)
c0106446:	83 e8 23             	sub    $0x23,%eax
c0106449:	83 f8 55             	cmp    $0x55,%eax
c010644c:	0f 87 6e 03 00 00    	ja     c01067c0 <vprintfmt+0x3e5>
c0106452:	8b 04 85 a0 84 10 c0 	mov    -0x3fef7b60(,%eax,4),%eax
c0106459:	ff e0                	jmp    *%eax

		// flag to pad on the right
		case '-':
			padc = '-';
c010645b:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
			goto reswitch;
c010645f:	eb d6                	jmp    c0106437 <vprintfmt+0x5c>

		// flag to pad with 0's instead of spaces
		case '0':
			padc = '0';
c0106461:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
			goto reswitch;
c0106465:	eb d0                	jmp    c0106437 <vprintfmt+0x5c>

		// width field
		case '1' ... '9':
			for (precision = 0; ; ++ fmt) {
c0106467:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
c010646e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0106471:	89 d0                	mov    %edx,%eax
c0106473:	c1 e0 02             	shl    $0x2,%eax
c0106476:	01 d0                	add    %edx,%eax
c0106478:	01 c0                	add    %eax,%eax
c010647a:	01 d8                	add    %ebx,%eax
c010647c:	83 e8 30             	sub    $0x30,%eax
c010647f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
				ch = *fmt;
c0106482:	8b 45 10             	mov    0x10(%ebp),%eax
c0106485:	0f b6 00             	movzbl (%eax),%eax
c0106488:	0f be d8             	movsbl %al,%ebx
				if (ch < '0' || ch > '9') {
c010648b:	83 fb 2f             	cmp    $0x2f,%ebx
c010648e:	7e 43                	jle    c01064d3 <vprintfmt+0xf8>
c0106490:	83 fb 39             	cmp    $0x39,%ebx
c0106493:	7f 41                	jg     c01064d6 <vprintfmt+0xfb>
			padc = '0';
			goto reswitch;

		// width field
		case '1' ... '9':
			for (precision = 0; ; ++ fmt) {
c0106495:	83 45 10 01          	addl   $0x1,0x10(%ebp)
				precision = precision * 10 + ch - '0';
				ch = *fmt;
				if (ch < '0' || ch > '9') {
					break;
				}
			}
c0106499:	eb d3                	jmp    c010646e <vprintfmt+0x93>
			goto process_precision;

		case '*':
			precision = va_arg(ap, int);
c010649b:	8b 45 14             	mov    0x14(%ebp),%eax
c010649e:	83 c0 04             	add    $0x4,%eax
c01064a1:	89 45 14             	mov    %eax,0x14(%ebp)
c01064a4:	8b 45 14             	mov    0x14(%ebp),%eax
c01064a7:	83 e8 04             	sub    $0x4,%eax
c01064aa:	8b 00                	mov    (%eax),%eax
c01064ac:	89 45 e4             	mov    %eax,-0x1c(%ebp)
			goto process_precision;
c01064af:	eb 26                	jmp    c01064d7 <vprintfmt+0xfc>

		case '.':
			if (width < 0)
c01064b1:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01064b5:	0f 89 78 ff ff ff    	jns    c0106433 <vprintfmt+0x58>
				width = 0;
c01064bb:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
			goto reswitch;
c01064c2:	e9 70 ff ff ff       	jmp    c0106437 <vprintfmt+0x5c>

		case '#':
			altflag = 1;
c01064c7:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
			goto reswitch;
c01064ce:	e9 64 ff ff ff       	jmp    c0106437 <vprintfmt+0x5c>
				ch = *fmt;
				if (ch < '0' || ch > '9') {
					break;
				}
			}
			goto process_precision;
c01064d3:	90                   	nop
c01064d4:	eb 01                	jmp    c01064d7 <vprintfmt+0xfc>
c01064d6:	90                   	nop
		case '#':
			altflag = 1;
			goto reswitch;

		process_precision:
			if (width < 0)
c01064d7:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01064db:	0f 89 55 ff ff ff    	jns    c0106436 <vprintfmt+0x5b>
				width = precision, precision = -1;
c01064e1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01064e4:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01064e7:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
			goto reswitch;
c01064ee:	e9 44 ff ff ff       	jmp    c0106437 <vprintfmt+0x5c>

		// long flag (doubled for long long)
		case 'l':
			lflag ++;
c01064f3:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
			goto reswitch;
c01064f7:	e9 3b ff ff ff       	jmp    c0106437 <vprintfmt+0x5c>

		// character
		case 'c':
			putch(va_arg(ap, int), putdat);
c01064fc:	8b 45 14             	mov    0x14(%ebp),%eax
c01064ff:	83 c0 04             	add    $0x4,%eax
c0106502:	89 45 14             	mov    %eax,0x14(%ebp)
c0106505:	8b 45 14             	mov    0x14(%ebp),%eax
c0106508:	83 e8 04             	sub    $0x4,%eax
c010650b:	8b 00                	mov    (%eax),%eax
c010650d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106510:	89 54 24 04          	mov    %edx,0x4(%esp)
c0106514:	89 04 24             	mov    %eax,(%esp)
c0106517:	8b 45 08             	mov    0x8(%ebp),%eax
c010651a:	ff d0                	call   *%eax
			break;
c010651c:	e9 ca 02 00 00       	jmp    c01067eb <vprintfmt+0x410>

		// error message
		case 'e':
			err = va_arg(ap, int);
c0106521:	8b 45 14             	mov    0x14(%ebp),%eax
c0106524:	83 c0 04             	add    $0x4,%eax
c0106527:	89 45 14             	mov    %eax,0x14(%ebp)
c010652a:	8b 45 14             	mov    0x14(%ebp),%eax
c010652d:	83 e8 04             	sub    $0x4,%eax
c0106530:	8b 18                	mov    (%eax),%ebx
			if (err < 0) {
c0106532:	85 db                	test   %ebx,%ebx
c0106534:	79 02                	jns    c0106538 <vprintfmt+0x15d>
				err = -err;
c0106536:	f7 db                	neg    %ebx
			}
			if (err > MAXERROR || (p = error_string[err]) == NULL) {
c0106538:	83 fb 06             	cmp    $0x6,%ebx
c010653b:	7f 0b                	jg     c0106548 <vprintfmt+0x16d>
c010653d:	8b 34 9d 60 84 10 c0 	mov    -0x3fef7ba0(,%ebx,4),%esi
c0106544:	85 f6                	test   %esi,%esi
c0106546:	75 23                	jne    c010656b <vprintfmt+0x190>
				printfmt(putch, putdat, "error %d", err);
c0106548:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c010654c:	c7 44 24 08 8d 84 10 	movl   $0xc010848d,0x8(%esp)
c0106553:	c0 
c0106554:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106557:	89 44 24 04          	mov    %eax,0x4(%esp)
c010655b:	8b 45 08             	mov    0x8(%ebp),%eax
c010655e:	89 04 24             	mov    %eax,(%esp)
c0106561:	e8 44 fe ff ff       	call   c01063aa <printfmt>
			}
			else {
				printfmt(putch, putdat, "%s", p);
			}
			break;
c0106566:	e9 80 02 00 00       	jmp    c01067eb <vprintfmt+0x410>
			}
			if (err > MAXERROR || (p = error_string[err]) == NULL) {
				printfmt(putch, putdat, "error %d", err);
			}
			else {
				printfmt(putch, putdat, "%s", p);
c010656b:	89 74 24 0c          	mov    %esi,0xc(%esp)
c010656f:	c7 44 24 08 96 84 10 	movl   $0xc0108496,0x8(%esp)
c0106576:	c0 
c0106577:	8b 45 0c             	mov    0xc(%ebp),%eax
c010657a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010657e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106581:	89 04 24             	mov    %eax,(%esp)
c0106584:	e8 21 fe ff ff       	call   c01063aa <printfmt>
			}
			break;
c0106589:	e9 5d 02 00 00       	jmp    c01067eb <vprintfmt+0x410>

		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL) {
c010658e:	8b 45 14             	mov    0x14(%ebp),%eax
c0106591:	83 c0 04             	add    $0x4,%eax
c0106594:	89 45 14             	mov    %eax,0x14(%ebp)
c0106597:	8b 45 14             	mov    0x14(%ebp),%eax
c010659a:	83 e8 04             	sub    $0x4,%eax
c010659d:	8b 30                	mov    (%eax),%esi
c010659f:	85 f6                	test   %esi,%esi
c01065a1:	75 05                	jne    c01065a8 <vprintfmt+0x1cd>
				p = "(null)";
c01065a3:	be 99 84 10 c0       	mov    $0xc0108499,%esi
			}
			if (width > 0 && padc != '-') {
c01065a8:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01065ac:	7e 7c                	jle    c010662a <vprintfmt+0x24f>
c01065ae:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
c01065b2:	74 79                	je     c010662d <vprintfmt+0x252>
				for (width -= strnlen(p, precision); width > 0; width --) {
c01065b4:	8b 5d e8             	mov    -0x18(%ebp),%ebx
c01065b7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01065ba:	89 44 24 04          	mov    %eax,0x4(%esp)
c01065be:	89 34 24             	mov    %esi,(%esp)
c01065c1:	e8 2d 03 00 00       	call   c01068f3 <strnlen>
c01065c6:	89 da                	mov    %ebx,%edx
c01065c8:	29 c2                	sub    %eax,%edx
c01065ca:	89 d0                	mov    %edx,%eax
c01065cc:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01065cf:	eb 17                	jmp    c01065e8 <vprintfmt+0x20d>
					putch(padc, putdat);
c01065d1:	0f be 45 db          	movsbl -0x25(%ebp),%eax
c01065d5:	8b 55 0c             	mov    0xc(%ebp),%edx
c01065d8:	89 54 24 04          	mov    %edx,0x4(%esp)
c01065dc:	89 04 24             	mov    %eax,(%esp)
c01065df:	8b 45 08             	mov    0x8(%ebp),%eax
c01065e2:	ff d0                	call   *%eax
		case 's':
			if ((p = va_arg(ap, char *)) == NULL) {
				p = "(null)";
			}
			if (width > 0 && padc != '-') {
				for (width -= strnlen(p, precision); width > 0; width --) {
c01065e4:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c01065e8:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01065ec:	7f e3                	jg     c01065d1 <vprintfmt+0x1f6>
					putch(padc, putdat);
				}
			}
			for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c01065ee:	eb 3e                	jmp    c010662e <vprintfmt+0x253>
				if (altflag && (ch < ' ' || ch > '~')) {
c01065f0:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c01065f4:	74 1f                	je     c0106615 <vprintfmt+0x23a>
c01065f6:	83 fb 1f             	cmp    $0x1f,%ebx
c01065f9:	7e 05                	jle    c0106600 <vprintfmt+0x225>
c01065fb:	83 fb 7e             	cmp    $0x7e,%ebx
c01065fe:	7e 15                	jle    c0106615 <vprintfmt+0x23a>
					putch('?', putdat);
c0106600:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106603:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106607:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
c010660e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106611:	ff d0                	call   *%eax
c0106613:	eb 0f                	jmp    c0106624 <vprintfmt+0x249>
				}
				else {
					putch(ch, putdat);
c0106615:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106618:	89 44 24 04          	mov    %eax,0x4(%esp)
c010661c:	89 1c 24             	mov    %ebx,(%esp)
c010661f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106622:	ff d0                	call   *%eax
			if (width > 0 && padc != '-') {
				for (width -= strnlen(p, precision); width > 0; width --) {
					putch(padc, putdat);
				}
			}
			for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c0106624:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c0106628:	eb 04                	jmp    c010662e <vprintfmt+0x253>
c010662a:	90                   	nop
c010662b:	eb 01                	jmp    c010662e <vprintfmt+0x253>
c010662d:	90                   	nop
c010662e:	0f b6 06             	movzbl (%esi),%eax
c0106631:	0f be d8             	movsbl %al,%ebx
c0106634:	85 db                	test   %ebx,%ebx
c0106636:	0f 95 c0             	setne  %al
c0106639:	83 c6 01             	add    $0x1,%esi
c010663c:	84 c0                	test   %al,%al
c010663e:	74 29                	je     c0106669 <vprintfmt+0x28e>
c0106640:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0106644:	78 aa                	js     c01065f0 <vprintfmt+0x215>
c0106646:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
c010664a:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010664e:	79 a0                	jns    c01065f0 <vprintfmt+0x215>
				}
				else {
					putch(ch, putdat);
				}
			}
			for (; width > 0; width --) {
c0106650:	eb 17                	jmp    c0106669 <vprintfmt+0x28e>
				putch(' ', putdat);
c0106652:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106655:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106659:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0106660:	8b 45 08             	mov    0x8(%ebp),%eax
c0106663:	ff d0                	call   *%eax
				}
				else {
					putch(ch, putdat);
				}
			}
			for (; width > 0; width --) {
c0106665:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c0106669:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010666d:	7f e3                	jg     c0106652 <vprintfmt+0x277>
				putch(' ', putdat);
			}
			break;
c010666f:	e9 77 01 00 00       	jmp    c01067eb <vprintfmt+0x410>

		// (signed) decimal
		case 'd':
			num = getint(&ap, lflag);
c0106674:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106677:	89 44 24 04          	mov    %eax,0x4(%esp)
c010667b:	8d 45 14             	lea    0x14(%ebp),%eax
c010667e:	89 04 24             	mov    %eax,(%esp)
c0106681:	e8 bd fc ff ff       	call   c0106343 <getint>
c0106686:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106689:	89 55 f4             	mov    %edx,-0xc(%ebp)
			if ((long long)num < 0) {
c010668c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010668f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0106692:	85 d2                	test   %edx,%edx
c0106694:	79 26                	jns    c01066bc <vprintfmt+0x2e1>
				putch('-', putdat);
c0106696:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106699:	89 44 24 04          	mov    %eax,0x4(%esp)
c010669d:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
c01066a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01066a7:	ff d0                	call   *%eax
				num = -(long long)num;
c01066a9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01066ac:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01066af:	f7 d8                	neg    %eax
c01066b1:	83 d2 00             	adc    $0x0,%edx
c01066b4:	f7 da                	neg    %edx
c01066b6:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01066b9:	89 55 f4             	mov    %edx,-0xc(%ebp)
			}
			base = 10;
c01066bc:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
			goto number;
c01066c3:	e9 af 00 00 00       	jmp    c0106777 <vprintfmt+0x39c>

		// unsigned decimal
		case 'u':
			num = getuint(&ap, lflag);
c01066c8:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01066cb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01066cf:	8d 45 14             	lea    0x14(%ebp),%eax
c01066d2:	89 04 24             	mov    %eax,(%esp)
c01066d5:	e8 02 fc ff ff       	call   c01062dc <getuint>
c01066da:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01066dd:	89 55 f4             	mov    %edx,-0xc(%ebp)
			base = 10;
c01066e0:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
			goto number;
c01066e7:	e9 8b 00 00 00       	jmp    c0106777 <vprintfmt+0x39c>

		// (unsigned) octal
		case 'o':
			num = getuint(&ap, lflag);
c01066ec:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01066ef:	89 44 24 04          	mov    %eax,0x4(%esp)
c01066f3:	8d 45 14             	lea    0x14(%ebp),%eax
c01066f6:	89 04 24             	mov    %eax,(%esp)
c01066f9:	e8 de fb ff ff       	call   c01062dc <getuint>
c01066fe:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106701:	89 55 f4             	mov    %edx,-0xc(%ebp)
			base = 8;
c0106704:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
			goto number;
c010670b:	eb 6a                	jmp    c0106777 <vprintfmt+0x39c>

		// pointer
		case 'p':
			putch('0', putdat);
c010670d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106710:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106714:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
c010671b:	8b 45 08             	mov    0x8(%ebp),%eax
c010671e:	ff d0                	call   *%eax
			putch('x', putdat);
c0106720:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106723:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106727:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
c010672e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106731:	ff d0                	call   *%eax
			num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c0106733:	8b 45 14             	mov    0x14(%ebp),%eax
c0106736:	83 c0 04             	add    $0x4,%eax
c0106739:	89 45 14             	mov    %eax,0x14(%ebp)
c010673c:	8b 45 14             	mov    0x14(%ebp),%eax
c010673f:	83 e8 04             	sub    $0x4,%eax
c0106742:	8b 00                	mov    (%eax),%eax
c0106744:	ba 00 00 00 00       	mov    $0x0,%edx
c0106749:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010674c:	89 55 f4             	mov    %edx,-0xc(%ebp)
			base = 16;
c010674f:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
			goto number;
c0106756:	eb 1f                	jmp    c0106777 <vprintfmt+0x39c>

		// (unsigned) hexadecimal
		case 'x':
			num = getuint(&ap, lflag);
c0106758:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010675b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010675f:	8d 45 14             	lea    0x14(%ebp),%eax
c0106762:	89 04 24             	mov    %eax,(%esp)
c0106765:	e8 72 fb ff ff       	call   c01062dc <getuint>
c010676a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010676d:	89 55 f4             	mov    %edx,-0xc(%ebp)
			base = 16;
c0106770:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
		number:
			printnum(putch, putdat, num, base, width, padc);
c0106777:	0f be 55 db          	movsbl -0x25(%ebp),%edx
c010677b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010677e:	89 54 24 18          	mov    %edx,0x18(%esp)
c0106782:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0106785:	89 54 24 14          	mov    %edx,0x14(%esp)
c0106789:	89 44 24 10          	mov    %eax,0x10(%esp)
c010678d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106790:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0106793:	89 44 24 08          	mov    %eax,0x8(%esp)
c0106797:	89 54 24 0c          	mov    %edx,0xc(%esp)
c010679b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010679e:	89 44 24 04          	mov    %eax,0x4(%esp)
c01067a2:	8b 45 08             	mov    0x8(%ebp),%eax
c01067a5:	89 04 24             	mov    %eax,(%esp)
c01067a8:	e8 f7 f9 ff ff       	call   c01061a4 <printnum>
			break;
c01067ad:	eb 3c                	jmp    c01067eb <vprintfmt+0x410>

		// escaped '%' character
		case '%':
			putch(ch, putdat);
c01067af:	8b 45 0c             	mov    0xc(%ebp),%eax
c01067b2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01067b6:	89 1c 24             	mov    %ebx,(%esp)
c01067b9:	8b 45 08             	mov    0x8(%ebp),%eax
c01067bc:	ff d0                	call   *%eax
			break;
c01067be:	eb 2b                	jmp    c01067eb <vprintfmt+0x410>

		// unrecognized escape sequence - just print it literally
		default:
			putch('%', putdat);
c01067c0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01067c3:	89 44 24 04          	mov    %eax,0x4(%esp)
c01067c7:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
c01067ce:	8b 45 08             	mov    0x8(%ebp),%eax
c01067d1:	ff d0                	call   *%eax
			for (fmt --; fmt[-1] != '%'; fmt --)
c01067d3:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01067d7:	eb 04                	jmp    c01067dd <vprintfmt+0x402>
c01067d9:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01067dd:	8b 45 10             	mov    0x10(%ebp),%eax
c01067e0:	83 e8 01             	sub    $0x1,%eax
c01067e3:	0f b6 00             	movzbl (%eax),%eax
c01067e6:	3c 25                	cmp    $0x25,%al
c01067e8:	75 ef                	jne    c01067d9 <vprintfmt+0x3fe>
				/* do nothing */;
			break;
c01067ea:	90                   	nop
		}
	}
c01067eb:	90                   	nop
	register int ch, err;
	unsigned long long num;
	int base, width, precision, lflag, altflag;

	while (1) {
		while ((ch = *(unsigned char *)fmt ++) != '%') {
c01067ec:	e9 0b fc ff ff       	jmp    c01063fc <vprintfmt+0x21>
			for (fmt --; fmt[-1] != '%'; fmt --)
				/* do nothing */;
			break;
		}
	}
}
c01067f1:	83 c4 40             	add    $0x40,%esp
c01067f4:	5b                   	pop    %ebx
c01067f5:	5e                   	pop    %esi
c01067f6:	5d                   	pop    %ebp
c01067f7:	c3                   	ret    

c01067f8 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:			the character will be printed
 * @b:			the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c01067f8:	55                   	push   %ebp
c01067f9:	89 e5                	mov    %esp,%ebp
	b->cnt ++;
c01067fb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01067fe:	8b 40 08             	mov    0x8(%eax),%eax
c0106801:	8d 50 01             	lea    0x1(%eax),%edx
c0106804:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106807:	89 50 08             	mov    %edx,0x8(%eax)
	if (b->buf < b->ebuf) {
c010680a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010680d:	8b 10                	mov    (%eax),%edx
c010680f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106812:	8b 40 04             	mov    0x4(%eax),%eax
c0106815:	39 c2                	cmp    %eax,%edx
c0106817:	73 12                	jae    c010682b <sprintputch+0x33>
		*b->buf ++ = ch;
c0106819:	8b 45 0c             	mov    0xc(%ebp),%eax
c010681c:	8b 00                	mov    (%eax),%eax
c010681e:	8b 55 08             	mov    0x8(%ebp),%edx
c0106821:	88 10                	mov    %dl,(%eax)
c0106823:	8d 50 01             	lea    0x1(%eax),%edx
c0106826:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106829:	89 10                	mov    %edx,(%eax)
	}
}
c010682b:	5d                   	pop    %ebp
c010682c:	c3                   	ret    

c010682d <snprintf>:
 * @str:		the buffer to place the result into
 * @size:		the size of buffer, including the trailing null space
 * @fmt:		the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c010682d:	55                   	push   %ebp
c010682e:	89 e5                	mov    %esp,%ebp
c0106830:	83 ec 28             	sub    $0x28,%esp
	va_list ap;
	int cnt;
	va_start(ap, fmt);
c0106833:	8d 45 10             	lea    0x10(%ebp),%eax
c0106836:	83 c0 04             	add    $0x4,%eax
c0106839:	89 45 f4             	mov    %eax,-0xc(%ebp)
	cnt = vsnprintf(str, size, fmt, ap);
c010683c:	8b 45 10             	mov    0x10(%ebp),%eax
c010683f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0106842:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0106846:	89 44 24 08          	mov    %eax,0x8(%esp)
c010684a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010684d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106851:	8b 45 08             	mov    0x8(%ebp),%eax
c0106854:	89 04 24             	mov    %eax,(%esp)
c0106857:	e8 08 00 00 00       	call   c0106864 <vsnprintf>
c010685c:	89 45 f0             	mov    %eax,-0x10(%ebp)
	va_end(ap);
	return cnt;
c010685f:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0106862:	c9                   	leave  
c0106863:	c3                   	ret    

c0106864 <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c0106864:	55                   	push   %ebp
c0106865:	89 e5                	mov    %esp,%ebp
c0106867:	83 ec 28             	sub    $0x28,%esp
	struct sprintbuf b = {str, str + size - 1, 0};
c010686a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010686d:	83 e8 01             	sub    $0x1,%eax
c0106870:	03 45 08             	add    0x8(%ebp),%eax
c0106873:	8b 55 08             	mov    0x8(%ebp),%edx
c0106876:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0106879:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010687c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	if (str == NULL || b.buf > b.ebuf) {
c0106883:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0106887:	74 0a                	je     c0106893 <vsnprintf+0x2f>
c0106889:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010688c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010688f:	39 c2                	cmp    %eax,%edx
c0106891:	76 07                	jbe    c010689a <vsnprintf+0x36>
		return -E_INVAL;
c0106893:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c0106898:	eb 2b                	jmp    c01068c5 <vsnprintf+0x61>
	}
	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
c010689a:	b8 f8 67 10 c0       	mov    $0xc01067f8,%eax
c010689f:	8b 55 14             	mov    0x14(%ebp),%edx
c01068a2:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01068a6:	8b 55 10             	mov    0x10(%ebp),%edx
c01068a9:	89 54 24 08          	mov    %edx,0x8(%esp)
c01068ad:	8d 55 ec             	lea    -0x14(%ebp),%edx
c01068b0:	89 54 24 04          	mov    %edx,0x4(%esp)
c01068b4:	89 04 24             	mov    %eax,(%esp)
c01068b7:	e8 1f fb ff ff       	call   c01063db <vprintfmt>
	// null terminate the buffer
	*b.buf = '\0';
c01068bc:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01068bf:	c6 00 00             	movb   $0x0,(%eax)
	return b.cnt;
c01068c2:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01068c5:	c9                   	leave  
c01068c6:	c3                   	ret    
	...

c01068c8 <strlen>:
 * @s:		the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c01068c8:	55                   	push   %ebp
c01068c9:	89 e5                	mov    %esp,%ebp
c01068cb:	83 ec 10             	sub    $0x10,%esp
	size_t cnt = 0;
c01068ce:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
	while (*s ++ != '\0') {
c01068d5:	eb 04                	jmp    c01068db <strlen+0x13>
		cnt ++;
c01068d7:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
	size_t cnt = 0;
	while (*s ++ != '\0') {
c01068db:	8b 45 08             	mov    0x8(%ebp),%eax
c01068de:	0f b6 00             	movzbl (%eax),%eax
c01068e1:	84 c0                	test   %al,%al
c01068e3:	0f 95 c0             	setne  %al
c01068e6:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c01068ea:	84 c0                	test   %al,%al
c01068ec:	75 e9                	jne    c01068d7 <strlen+0xf>
		cnt ++;
	}
	return cnt;
c01068ee:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01068f1:	c9                   	leave  
c01068f2:	c3                   	ret    

c01068f3 <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c01068f3:	55                   	push   %ebp
c01068f4:	89 e5                	mov    %esp,%ebp
c01068f6:	83 ec 10             	sub    $0x10,%esp
	size_t cnt = 0;
c01068f9:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
	while (cnt < len && *s ++ != '\0') {
c0106900:	eb 04                	jmp    c0106906 <strnlen+0x13>
		cnt ++;
c0106902:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
	size_t cnt = 0;
	while (cnt < len && *s ++ != '\0') {
c0106906:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106909:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010690c:	73 13                	jae    c0106921 <strnlen+0x2e>
c010690e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106911:	0f b6 00             	movzbl (%eax),%eax
c0106914:	84 c0                	test   %al,%al
c0106916:	0f 95 c0             	setne  %al
c0106919:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c010691d:	84 c0                	test   %al,%al
c010691f:	75 e1                	jne    c0106902 <strnlen+0xf>
		cnt ++;
	}
	return cnt;
c0106921:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0106924:	c9                   	leave  
c0106925:	c3                   	ret    

c0106926 <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c0106926:	55                   	push   %ebp
c0106927:	89 e5                	mov    %esp,%ebp
c0106929:	57                   	push   %edi
c010692a:	56                   	push   %esi
c010692b:	53                   	push   %ebx
c010692c:	83 ec 24             	sub    $0x24,%esp
c010692f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106932:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106935:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106938:	89 45 ec             	mov    %eax,-0x14(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
	int d0, d1, d2;
	asm volatile (
c010693b:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010693e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106941:	89 d6                	mov    %edx,%esi
c0106943:	89 c3                	mov    %eax,%ebx
c0106945:	89 df                	mov    %ebx,%edi
c0106947:	ac                   	lods   %ds:(%esi),%al
c0106948:	aa                   	stos   %al,%es:(%edi)
c0106949:	84 c0                	test   %al,%al
c010694b:	75 fa                	jne    c0106947 <strcpy+0x21>
c010694d:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0106950:	89 fb                	mov    %edi,%ebx
c0106952:	89 75 e8             	mov    %esi,-0x18(%ebp)
c0106955:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
c0106958:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010695b:	89 45 e0             	mov    %eax,-0x20(%ebp)
			"stosb;"
			"testb %%al, %%al;"
			"jne 1b;"
			: "=&S" (d0), "=&D" (d1), "=&a" (d2)
			: "0" (src), "1" (dst) : "memory");
	return dst;
c010695e:	8b 45 f0             	mov    -0x10(%ebp),%eax
	char *p = dst;
	while ((*p ++ = *src ++) != '\0')
		/* nothing */;
	return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c0106961:	83 c4 24             	add    $0x24,%esp
c0106964:	5b                   	pop    %ebx
c0106965:	5e                   	pop    %esi
c0106966:	5f                   	pop    %edi
c0106967:	5d                   	pop    %ebp
c0106968:	c3                   	ret    

c0106969 <strncpy>:
 * @len:	maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0106969:	55                   	push   %ebp
c010696a:	89 e5                	mov    %esp,%ebp
c010696c:	83 ec 10             	sub    $0x10,%esp
	char *p = dst;
c010696f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106972:	89 45 fc             	mov    %eax,-0x4(%ebp)
	while (len > 0) {
c0106975:	eb 21                	jmp    c0106998 <strncpy+0x2f>
		if ((*p = *src) != '\0') {
c0106977:	8b 45 0c             	mov    0xc(%ebp),%eax
c010697a:	0f b6 10             	movzbl (%eax),%edx
c010697d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106980:	88 10                	mov    %dl,(%eax)
c0106982:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106985:	0f b6 00             	movzbl (%eax),%eax
c0106988:	84 c0                	test   %al,%al
c010698a:	74 04                	je     c0106990 <strncpy+0x27>
			src ++;
c010698c:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
		}
		p ++, len --;
c0106990:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0106994:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
	char *p = dst;
	while (len > 0) {
c0106998:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c010699c:	75 d9                	jne    c0106977 <strncpy+0xe>
		if ((*p = *src) != '\0') {
			src ++;
		}
		p ++, len --;
	}
	return dst;
c010699e:	8b 45 08             	mov    0x8(%ebp),%eax
}
c01069a1:	c9                   	leave  
c01069a2:	c3                   	ret    

c01069a3 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c01069a3:	55                   	push   %ebp
c01069a4:	89 e5                	mov    %esp,%ebp
c01069a6:	57                   	push   %edi
c01069a7:	56                   	push   %esi
c01069a8:	53                   	push   %ebx
c01069a9:	83 ec 24             	sub    $0x24,%esp
c01069ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01069af:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01069b2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01069b5:	89 45 ec             	mov    %eax,-0x14(%ebp)
#ifndef __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_STRCMP
static inline int
__strcmp(const char *s1, const char *s2) {
	int d0, d1, ret;
	asm volatile (
c01069b8:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01069bb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01069be:	89 d6                	mov    %edx,%esi
c01069c0:	89 c3                	mov    %eax,%ebx
c01069c2:	89 df                	mov    %ebx,%edi
c01069c4:	ac                   	lods   %ds:(%esi),%al
c01069c5:	ae                   	scas   %es:(%edi),%al
c01069c6:	75 08                	jne    c01069d0 <strcmp+0x2d>
c01069c8:	84 c0                	test   %al,%al
c01069ca:	75 f8                	jne    c01069c4 <strcmp+0x21>
c01069cc:	31 c0                	xor    %eax,%eax
c01069ce:	eb 04                	jmp    c01069d4 <strcmp+0x31>
c01069d0:	19 c0                	sbb    %eax,%eax
c01069d2:	0c 01                	or     $0x1,%al
c01069d4:	89 fb                	mov    %edi,%ebx
c01069d6:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01069d9:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01069dc:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01069df:	89 75 e4             	mov    %esi,-0x1c(%ebp)
c01069e2:	89 5d e0             	mov    %ebx,-0x20(%ebp)
			"orb $1, %%al;"
			"3:"
			: "=a" (ret), "=&S" (d0), "=&D" (d1)
			: "1" (s1), "2" (s2)
			: "memory");
	return ret;
c01069e5:	8b 45 e8             	mov    -0x18(%ebp),%eax
	while (*s1 != '\0' && *s1 == *s2) {
		s1 ++, s2 ++;
	}
	return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c01069e8:	83 c4 24             	add    $0x24,%esp
c01069eb:	5b                   	pop    %ebx
c01069ec:	5e                   	pop    %esi
c01069ed:	5f                   	pop    %edi
c01069ee:	5d                   	pop    %ebp
c01069ef:	c3                   	ret    

c01069f0 <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c01069f0:	55                   	push   %ebp
c01069f1:	89 e5                	mov    %esp,%ebp
	while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c01069f3:	eb 0c                	jmp    c0106a01 <strncmp+0x11>
		n --, s1 ++, s2 ++;
c01069f5:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01069f9:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c01069fd:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
	while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0106a01:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106a05:	74 1a                	je     c0106a21 <strncmp+0x31>
c0106a07:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a0a:	0f b6 00             	movzbl (%eax),%eax
c0106a0d:	84 c0                	test   %al,%al
c0106a0f:	74 10                	je     c0106a21 <strncmp+0x31>
c0106a11:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a14:	0f b6 10             	movzbl (%eax),%edx
c0106a17:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106a1a:	0f b6 00             	movzbl (%eax),%eax
c0106a1d:	38 c2                	cmp    %al,%dl
c0106a1f:	74 d4                	je     c01069f5 <strncmp+0x5>
		n --, s1 ++, s2 ++;
	}
	return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c0106a21:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106a25:	74 1a                	je     c0106a41 <strncmp+0x51>
c0106a27:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a2a:	0f b6 00             	movzbl (%eax),%eax
c0106a2d:	0f b6 d0             	movzbl %al,%edx
c0106a30:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106a33:	0f b6 00             	movzbl (%eax),%eax
c0106a36:	0f b6 c0             	movzbl %al,%eax
c0106a39:	89 d1                	mov    %edx,%ecx
c0106a3b:	29 c1                	sub    %eax,%ecx
c0106a3d:	89 c8                	mov    %ecx,%eax
c0106a3f:	eb 05                	jmp    c0106a46 <strncmp+0x56>
c0106a41:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0106a46:	5d                   	pop    %ebp
c0106a47:	c3                   	ret    

c0106a48 <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0106a48:	55                   	push   %ebp
c0106a49:	89 e5                	mov    %esp,%ebp
c0106a4b:	83 ec 04             	sub    $0x4,%esp
c0106a4e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106a51:	88 45 fc             	mov    %al,-0x4(%ebp)
	while (*s != '\0') {
c0106a54:	eb 14                	jmp    c0106a6a <strchr+0x22>
		if (*s == c) {
c0106a56:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a59:	0f b6 00             	movzbl (%eax),%eax
c0106a5c:	3a 45 fc             	cmp    -0x4(%ebp),%al
c0106a5f:	75 05                	jne    c0106a66 <strchr+0x1e>
			return (char *)s;
c0106a61:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a64:	eb 13                	jmp    c0106a79 <strchr+0x31>
		}
		s ++;
c0106a66:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
	while (*s != '\0') {
c0106a6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a6d:	0f b6 00             	movzbl (%eax),%eax
c0106a70:	84 c0                	test   %al,%al
c0106a72:	75 e2                	jne    c0106a56 <strchr+0xe>
		if (*s == c) {
			return (char *)s;
		}
		s ++;
	}
	return NULL;
c0106a74:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0106a79:	c9                   	leave  
c0106a7a:	c3                   	ret    

c0106a7b <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0106a7b:	55                   	push   %ebp
c0106a7c:	89 e5                	mov    %esp,%ebp
c0106a7e:	83 ec 04             	sub    $0x4,%esp
c0106a81:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106a84:	88 45 fc             	mov    %al,-0x4(%ebp)
	while (*s != '\0') {
c0106a87:	eb 0f                	jmp    c0106a98 <strfind+0x1d>
		if (*s == c) {
c0106a89:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a8c:	0f b6 00             	movzbl (%eax),%eax
c0106a8f:	3a 45 fc             	cmp    -0x4(%ebp),%al
c0106a92:	74 10                	je     c0106aa4 <strfind+0x29>
			break;
		}
		s ++;
c0106a94:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
	while (*s != '\0') {
c0106a98:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a9b:	0f b6 00             	movzbl (%eax),%eax
c0106a9e:	84 c0                	test   %al,%al
c0106aa0:	75 e7                	jne    c0106a89 <strfind+0xe>
c0106aa2:	eb 01                	jmp    c0106aa5 <strfind+0x2a>
		if (*s == c) {
			break;
c0106aa4:	90                   	nop
		}
		s ++;
	}
	return (char *)s;
c0106aa5:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0106aa8:	c9                   	leave  
c0106aa9:	c3                   	ret    

c0106aaa <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0106aaa:	55                   	push   %ebp
c0106aab:	89 e5                	mov    %esp,%ebp
c0106aad:	83 ec 10             	sub    $0x10,%esp
	int neg = 0;
c0106ab0:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
	long val = 0;
c0106ab7:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t') {
c0106abe:	eb 04                	jmp    c0106ac4 <strtol+0x1a>
		s ++;
c0106ac0:	83 45 08 01          	addl   $0x1,0x8(%ebp)
strtol(const char *s, char **endptr, int base) {
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t') {
c0106ac4:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ac7:	0f b6 00             	movzbl (%eax),%eax
c0106aca:	3c 20                	cmp    $0x20,%al
c0106acc:	74 f2                	je     c0106ac0 <strtol+0x16>
c0106ace:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ad1:	0f b6 00             	movzbl (%eax),%eax
c0106ad4:	3c 09                	cmp    $0x9,%al
c0106ad6:	74 e8                	je     c0106ac0 <strtol+0x16>
		s ++;
	}

	// plus/minus sign
	if (*s == '+') {
c0106ad8:	8b 45 08             	mov    0x8(%ebp),%eax
c0106adb:	0f b6 00             	movzbl (%eax),%eax
c0106ade:	3c 2b                	cmp    $0x2b,%al
c0106ae0:	75 06                	jne    c0106ae8 <strtol+0x3e>
		s ++;
c0106ae2:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0106ae6:	eb 15                	jmp    c0106afd <strtol+0x53>
	}
	else if (*s == '-') {
c0106ae8:	8b 45 08             	mov    0x8(%ebp),%eax
c0106aeb:	0f b6 00             	movzbl (%eax),%eax
c0106aee:	3c 2d                	cmp    $0x2d,%al
c0106af0:	75 0b                	jne    c0106afd <strtol+0x53>
		s ++, neg = 1;
c0106af2:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0106af6:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
	}

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0106afd:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106b01:	74 06                	je     c0106b09 <strtol+0x5f>
c0106b03:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0106b07:	75 24                	jne    c0106b2d <strtol+0x83>
c0106b09:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b0c:	0f b6 00             	movzbl (%eax),%eax
c0106b0f:	3c 30                	cmp    $0x30,%al
c0106b11:	75 1a                	jne    c0106b2d <strtol+0x83>
c0106b13:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b16:	83 c0 01             	add    $0x1,%eax
c0106b19:	0f b6 00             	movzbl (%eax),%eax
c0106b1c:	3c 78                	cmp    $0x78,%al
c0106b1e:	75 0d                	jne    c0106b2d <strtol+0x83>
		s += 2, base = 16;
c0106b20:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0106b24:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
c0106b2b:	eb 2a                	jmp    c0106b57 <strtol+0xad>
	}
	else if (base == 0 && s[0] == '0') {
c0106b2d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106b31:	75 17                	jne    c0106b4a <strtol+0xa0>
c0106b33:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b36:	0f b6 00             	movzbl (%eax),%eax
c0106b39:	3c 30                	cmp    $0x30,%al
c0106b3b:	75 0d                	jne    c0106b4a <strtol+0xa0>
		s ++, base = 8;
c0106b3d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0106b41:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
c0106b48:	eb 0d                	jmp    c0106b57 <strtol+0xad>
	}
	else if (base == 0) {
c0106b4a:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106b4e:	75 07                	jne    c0106b57 <strtol+0xad>
		base = 10;
c0106b50:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9') {
c0106b57:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b5a:	0f b6 00             	movzbl (%eax),%eax
c0106b5d:	3c 2f                	cmp    $0x2f,%al
c0106b5f:	7e 1b                	jle    c0106b7c <strtol+0xd2>
c0106b61:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b64:	0f b6 00             	movzbl (%eax),%eax
c0106b67:	3c 39                	cmp    $0x39,%al
c0106b69:	7f 11                	jg     c0106b7c <strtol+0xd2>
			dig = *s - '0';
c0106b6b:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b6e:	0f b6 00             	movzbl (%eax),%eax
c0106b71:	0f be c0             	movsbl %al,%eax
c0106b74:	83 e8 30             	sub    $0x30,%eax
c0106b77:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0106b7a:	eb 48                	jmp    c0106bc4 <strtol+0x11a>
		}
		else if (*s >= 'a' && *s <= 'z') {
c0106b7c:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b7f:	0f b6 00             	movzbl (%eax),%eax
c0106b82:	3c 60                	cmp    $0x60,%al
c0106b84:	7e 1b                	jle    c0106ba1 <strtol+0xf7>
c0106b86:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b89:	0f b6 00             	movzbl (%eax),%eax
c0106b8c:	3c 7a                	cmp    $0x7a,%al
c0106b8e:	7f 11                	jg     c0106ba1 <strtol+0xf7>
			dig = *s - 'a' + 10;
c0106b90:	8b 45 08             	mov    0x8(%ebp),%eax
c0106b93:	0f b6 00             	movzbl (%eax),%eax
c0106b96:	0f be c0             	movsbl %al,%eax
c0106b99:	83 e8 57             	sub    $0x57,%eax
c0106b9c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0106b9f:	eb 23                	jmp    c0106bc4 <strtol+0x11a>
		}
		else if (*s >= 'A' && *s <= 'Z') {
c0106ba1:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ba4:	0f b6 00             	movzbl (%eax),%eax
c0106ba7:	3c 40                	cmp    $0x40,%al
c0106ba9:	7e 38                	jle    c0106be3 <strtol+0x139>
c0106bab:	8b 45 08             	mov    0x8(%ebp),%eax
c0106bae:	0f b6 00             	movzbl (%eax),%eax
c0106bb1:	3c 5a                	cmp    $0x5a,%al
c0106bb3:	7f 2e                	jg     c0106be3 <strtol+0x139>
			dig = *s - 'A' + 10;
c0106bb5:	8b 45 08             	mov    0x8(%ebp),%eax
c0106bb8:	0f b6 00             	movzbl (%eax),%eax
c0106bbb:	0f be c0             	movsbl %al,%eax
c0106bbe:	83 e8 37             	sub    $0x37,%eax
c0106bc1:	89 45 f4             	mov    %eax,-0xc(%ebp)
		}
		else {
			break;
		}
		if (dig >= base) {
c0106bc4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106bc7:	3b 45 10             	cmp    0x10(%ebp),%eax
c0106bca:	7d 16                	jge    c0106be2 <strtol+0x138>
			break;
		}
		s ++, val = (val * base) + dig;
c0106bcc:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0106bd0:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0106bd3:	0f af 45 10          	imul   0x10(%ebp),%eax
c0106bd7:	03 45 f4             	add    -0xc(%ebp),%eax
c0106bda:	89 45 f8             	mov    %eax,-0x8(%ebp)
		// we don't properly detect overflow!
	}
c0106bdd:	e9 75 ff ff ff       	jmp    c0106b57 <strtol+0xad>
		}
		else {
			break;
		}
		if (dig >= base) {
			break;
c0106be2:	90                   	nop
		}
		s ++, val = (val * base) + dig;
		// we don't properly detect overflow!
	}

	if (endptr) {
c0106be3:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0106be7:	74 08                	je     c0106bf1 <strtol+0x147>
		*endptr = (char *) s;
c0106be9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106bec:	8b 55 08             	mov    0x8(%ebp),%edx
c0106bef:	89 10                	mov    %edx,(%eax)
	}
	return (neg ? -val : val);
c0106bf1:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0106bf5:	74 07                	je     c0106bfe <strtol+0x154>
c0106bf7:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0106bfa:	f7 d8                	neg    %eax
c0106bfc:	eb 03                	jmp    c0106c01 <strtol+0x157>
c0106bfe:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0106c01:	c9                   	leave  
c0106c02:	c3                   	ret    

c0106c03 <memset>:
 * @n:		number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0106c03:	55                   	push   %ebp
c0106c04:	89 e5                	mov    %esp,%ebp
c0106c06:	57                   	push   %edi
c0106c07:	56                   	push   %esi
c0106c08:	53                   	push   %ebx
c0106c09:	83 ec 24             	sub    $0x24,%esp
c0106c0c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106c0f:	88 45 d0             	mov    %al,-0x30(%ebp)
#ifdef __HAVE_ARCH_MEMSET
	return __memset(s, c, n);
c0106c12:	0f be 45 d0          	movsbl -0x30(%ebp),%eax
c0106c16:	8b 55 08             	mov    0x8(%ebp),%edx
c0106c19:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0106c1c:	88 45 ef             	mov    %al,-0x11(%ebp)
c0106c1f:	8b 45 10             	mov    0x10(%ebp),%eax
c0106c22:	89 45 e8             	mov    %eax,-0x18(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
	int d0, d1;
	asm volatile (
c0106c25:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c0106c28:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
c0106c2c:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0106c2f:	89 ce                	mov    %ecx,%esi
c0106c31:	89 d3                	mov    %edx,%ebx
c0106c33:	89 f1                	mov    %esi,%ecx
c0106c35:	89 df                	mov    %ebx,%edi
c0106c37:	f3 aa                	rep stos %al,%es:(%edi)
c0106c39:	89 fb                	mov    %edi,%ebx
c0106c3b:	89 ce                	mov    %ecx,%esi
c0106c3d:	89 75 e4             	mov    %esi,-0x1c(%ebp)
c0106c40:	89 5d e0             	mov    %ebx,-0x20(%ebp)
			"rep; stosb;"
			: "=&c" (d0), "=&D" (d1)
			: "0" (n), "a" (c), "1" (s)
			: "memory");
	return s;
c0106c43:	8b 45 f0             	mov    -0x10(%ebp),%eax
	while (n -- > 0) {
		*p ++ = c;
	}
	return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0106c46:	83 c4 24             	add    $0x24,%esp
c0106c49:	5b                   	pop    %ebx
c0106c4a:	5e                   	pop    %esi
c0106c4b:	5f                   	pop    %edi
c0106c4c:	5d                   	pop    %ebp
c0106c4d:	c3                   	ret    

c0106c4e <memmove>:
 * @n:		number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0106c4e:	55                   	push   %ebp
c0106c4f:	89 e5                	mov    %esp,%ebp
c0106c51:	57                   	push   %edi
c0106c52:	56                   	push   %esi
c0106c53:	53                   	push   %ebx
c0106c54:	83 ec 38             	sub    $0x38,%esp
c0106c57:	8b 45 08             	mov    0x8(%ebp),%eax
c0106c5a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106c5d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106c60:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106c63:	8b 45 10             	mov    0x10(%ebp),%eax
c0106c66:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
	if (dst < src) {
c0106c69:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106c6c:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0106c6f:	73 4e                	jae    c0106cbf <memmove+0x71>
c0106c71:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106c74:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0106c77:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106c7a:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0106c7d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106c80:	89 45 dc             	mov    %eax,-0x24(%ebp)
			"andl $3, %%ecx;"
			"jz 1f;"
			"rep; movsb;"
			"1:"
			: "=&c" (d0), "=&D" (d1), "=&S" (d2)
			: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0106c83:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0106c86:	89 c1                	mov    %eax,%ecx
c0106c88:	c1 e9 02             	shr    $0x2,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
	int d0, d1, d2;
	asm volatile (
c0106c8b:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0106c8e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106c91:	89 4d c0             	mov    %ecx,-0x40(%ebp)
c0106c94:	89 d7                	mov    %edx,%edi
c0106c96:	89 c3                	mov    %eax,%ebx
c0106c98:	8b 4d c0             	mov    -0x40(%ebp),%ecx
c0106c9b:	89 de                	mov    %ebx,%esi
c0106c9d:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0106c9f:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0106ca2:	83 e1 03             	and    $0x3,%ecx
c0106ca5:	74 02                	je     c0106ca9 <memmove+0x5b>
c0106ca7:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0106ca9:	89 f3                	mov    %esi,%ebx
c0106cab:	89 4d c0             	mov    %ecx,-0x40(%ebp)
c0106cae:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0106cb1:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0106cb4:	89 7d d4             	mov    %edi,-0x2c(%ebp)
c0106cb7:	89 5d d0             	mov    %ebx,-0x30(%ebp)
			"rep; movsb;"
			"1:"
			: "=&c" (d0), "=&D" (d1), "=&S" (d2)
			: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
			: "memory");
	return dst;
c0106cba:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106cbd:	eb 3b                	jmp    c0106cfa <memmove+0xac>
	asm volatile (
			"std;"
			"rep; movsb;"
			"cld;"
			: "=&c" (d0), "=&S" (d1), "=&D" (d2)
			: "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0106cbf:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106cc2:	83 e8 01             	sub    $0x1,%eax
c0106cc5:	89 c2                	mov    %eax,%edx
c0106cc7:	03 55 ec             	add    -0x14(%ebp),%edx
c0106cca:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106ccd:	83 e8 01             	sub    $0x1,%eax
c0106cd0:	03 45 f0             	add    -0x10(%ebp),%eax
__memmove(void *dst, const void *src, size_t n) {
	if (dst < src) {
		return __memcpy(dst, src, n);
	}
	int d0, d1, d2;
	asm volatile (
c0106cd3:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c0106cd6:	89 4d bc             	mov    %ecx,-0x44(%ebp)
c0106cd9:	89 d6                	mov    %edx,%esi
c0106cdb:	89 c3                	mov    %eax,%ebx
c0106cdd:	8b 4d bc             	mov    -0x44(%ebp),%ecx
c0106ce0:	89 df                	mov    %ebx,%edi
c0106ce2:	fd                   	std    
c0106ce3:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0106ce5:	fc                   	cld    
c0106ce6:	89 fb                	mov    %edi,%ebx
c0106ce8:	89 4d bc             	mov    %ecx,-0x44(%ebp)
c0106ceb:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0106cee:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0106cf1:	89 75 c8             	mov    %esi,-0x38(%ebp)
c0106cf4:	89 5d c4             	mov    %ebx,-0x3c(%ebp)
			"rep; movsb;"
			"cld;"
			: "=&c" (d0), "=&S" (d1), "=&D" (d2)
			: "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
			: "memory");
	return dst;
c0106cf7:	8b 45 f0             	mov    -0x10(%ebp),%eax
			*d ++ = *s ++;
		}
	}
	return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c0106cfa:	83 c4 38             	add    $0x38,%esp
c0106cfd:	5b                   	pop    %ebx
c0106cfe:	5e                   	pop    %esi
c0106cff:	5f                   	pop    %edi
c0106d00:	5d                   	pop    %ebp
c0106d01:	c3                   	ret    

c0106d02 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0106d02:	55                   	push   %ebp
c0106d03:	89 e5                	mov    %esp,%ebp
c0106d05:	57                   	push   %edi
c0106d06:	56                   	push   %esi
c0106d07:	53                   	push   %ebx
c0106d08:	83 ec 24             	sub    $0x24,%esp
c0106d0b:	8b 45 08             	mov    0x8(%ebp),%eax
c0106d0e:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106d11:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106d14:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106d17:	8b 45 10             	mov    0x10(%ebp),%eax
c0106d1a:	89 45 e8             	mov    %eax,-0x18(%ebp)
			"andl $3, %%ecx;"
			"jz 1f;"
			"rep; movsb;"
			"1:"
			: "=&c" (d0), "=&D" (d1), "=&S" (d2)
			: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0106d1d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106d20:	89 c1                	mov    %eax,%ecx
c0106d22:	c1 e9 02             	shr    $0x2,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
	int d0, d1, d2;
	asm volatile (
c0106d25:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0106d28:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106d2b:	89 4d d0             	mov    %ecx,-0x30(%ebp)
c0106d2e:	89 d7                	mov    %edx,%edi
c0106d30:	89 c3                	mov    %eax,%ebx
c0106d32:	8b 4d d0             	mov    -0x30(%ebp),%ecx
c0106d35:	89 de                	mov    %ebx,%esi
c0106d37:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0106d39:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c0106d3c:	83 e1 03             	and    $0x3,%ecx
c0106d3f:	74 02                	je     c0106d43 <memcpy+0x41>
c0106d41:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0106d43:	89 f3                	mov    %esi,%ebx
c0106d45:	89 4d d0             	mov    %ecx,-0x30(%ebp)
c0106d48:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106d4b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0106d4e:	89 7d e0             	mov    %edi,-0x20(%ebp)
c0106d51:	89 5d dc             	mov    %ebx,-0x24(%ebp)
			"rep; movsb;"
			"1:"
			: "=&c" (d0), "=&D" (d1), "=&S" (d2)
			: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
			: "memory");
	return dst;
c0106d54:	8b 45 f0             	mov    -0x10(%ebp),%eax
	while (n -- > 0) {
		*d ++ = *s ++;
	}
	return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c0106d57:	83 c4 24             	add    $0x24,%esp
c0106d5a:	5b                   	pop    %ebx
c0106d5b:	5e                   	pop    %esi
c0106d5c:	5f                   	pop    %edi
c0106d5d:	5d                   	pop    %ebp
c0106d5e:	c3                   	ret    

c0106d5f <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0106d5f:	55                   	push   %ebp
c0106d60:	89 e5                	mov    %esp,%ebp
c0106d62:	83 ec 10             	sub    $0x10,%esp
	const char *s1 = (const char *)v1;
c0106d65:	8b 45 08             	mov    0x8(%ebp),%eax
c0106d68:	89 45 fc             	mov    %eax,-0x4(%ebp)
	const char *s2 = (const char *)v2;
c0106d6b:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106d6e:	89 45 f8             	mov    %eax,-0x8(%ebp)
	while (n -- > 0) {
c0106d71:	eb 32                	jmp    c0106da5 <memcmp+0x46>
		if (*s1 != *s2) {
c0106d73:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106d76:	0f b6 10             	movzbl (%eax),%edx
c0106d79:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0106d7c:	0f b6 00             	movzbl (%eax),%eax
c0106d7f:	38 c2                	cmp    %al,%dl
c0106d81:	74 1a                	je     c0106d9d <memcmp+0x3e>
			return (int)((unsigned char)*s1 - (unsigned char)*s2);
c0106d83:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106d86:	0f b6 00             	movzbl (%eax),%eax
c0106d89:	0f b6 d0             	movzbl %al,%edx
c0106d8c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0106d8f:	0f b6 00             	movzbl (%eax),%eax
c0106d92:	0f b6 c0             	movzbl %al,%eax
c0106d95:	89 d1                	mov    %edx,%ecx
c0106d97:	29 c1                	sub    %eax,%ecx
c0106d99:	89 c8                	mov    %ecx,%eax
c0106d9b:	eb 1c                	jmp    c0106db9 <memcmp+0x5a>
		}
		s1 ++, s2 ++;
c0106d9d:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0106da1:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
	const char *s1 = (const char *)v1;
	const char *s2 = (const char *)v2;
	while (n -- > 0) {
c0106da5:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0106da9:	0f 95 c0             	setne  %al
c0106dac:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c0106db0:	84 c0                	test   %al,%al
c0106db2:	75 bf                	jne    c0106d73 <memcmp+0x14>
		if (*s1 != *s2) {
			return (int)((unsigned char)*s1 - (unsigned char)*s2);
		}
		s1 ++, s2 ++;
	}
	return 0;
c0106db4:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0106db9:	c9                   	leave  
c0106dba:	c3                   	ret    
